@paygentic/sdk 0.6.29 → 0.6.34

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 (391) hide show
  1. package/FUNCTIONS.md +13 -9
  2. package/README.md +125 -55
  3. package/dist/commonjs/funcs/billableMetricsListEvents.d.ts +19 -0
  4. package/dist/commonjs/funcs/billableMetricsListEvents.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/billableMetricsListEvents.js +132 -0
  6. package/dist/commonjs/funcs/billableMetricsListEvents.js.map +1 -0
  7. package/dist/commonjs/funcs/costsCreateCost.d.ts +19 -0
  8. package/dist/commonjs/funcs/costsCreateCost.d.ts.map +1 -0
  9. package/dist/commonjs/funcs/costsCreateCost.js +119 -0
  10. package/dist/commonjs/funcs/costsCreateCost.js.map +1 -0
  11. package/dist/commonjs/funcs/costsDeleteCost.d.ts +15 -0
  12. package/dist/commonjs/funcs/costsDeleteCost.d.ts.map +1 -0
  13. package/dist/commonjs/funcs/costsDeleteCost.js +121 -0
  14. package/dist/commonjs/funcs/costsDeleteCost.js.map +1 -0
  15. package/dist/commonjs/funcs/costsGetCost.d.ts +16 -0
  16. package/dist/commonjs/funcs/costsGetCost.d.ts.map +1 -0
  17. package/dist/commonjs/funcs/costsGetCost.js +121 -0
  18. package/dist/commonjs/funcs/costsGetCost.js.map +1 -0
  19. package/dist/commonjs/funcs/costsGetCostSummary.d.ts +19 -0
  20. package/dist/commonjs/funcs/costsGetCostSummary.d.ts.map +1 -0
  21. package/dist/commonjs/funcs/costsGetCostSummary.js +133 -0
  22. package/dist/commonjs/funcs/costsGetCostSummary.js.map +1 -0
  23. package/dist/commonjs/funcs/costsListCosts.d.ts +15 -0
  24. package/dist/commonjs/funcs/costsListCosts.d.ts.map +1 -0
  25. package/dist/commonjs/funcs/costsListCosts.js +121 -0
  26. package/dist/commonjs/funcs/costsListCosts.js.map +1 -0
  27. package/dist/commonjs/funcs/costsUpdateCost.d.ts +16 -0
  28. package/dist/commonjs/funcs/costsUpdateCost.d.ts.map +1 -0
  29. package/dist/commonjs/funcs/costsUpdateCost.js +122 -0
  30. package/dist/commonjs/funcs/costsUpdateCost.js.map +1 -0
  31. package/dist/commonjs/funcs/entitlementsGet.js +4 -0
  32. package/dist/commonjs/funcs/entitlementsGet.js.map +1 -1
  33. package/dist/commonjs/funcs/entitlementsList.js +1 -0
  34. package/dist/commonjs/funcs/entitlementsList.js.map +1 -1
  35. package/dist/commonjs/lib/config.d.ts +3 -3
  36. package/dist/commonjs/lib/config.js +3 -3
  37. package/dist/commonjs/lib/config.js.map +1 -1
  38. package/dist/commonjs/lib/encodings.d.ts +1 -0
  39. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  40. package/dist/commonjs/lib/encodings.js +7 -0
  41. package/dist/commonjs/lib/encodings.js.map +1 -1
  42. package/dist/commonjs/models/billablemetric.d.ts +4 -4
  43. package/dist/commonjs/models/billablemetric.d.ts.map +1 -1
  44. package/dist/commonjs/models/billablemetric.js +4 -5
  45. package/dist/commonjs/models/billablemetric.js.map +1 -1
  46. package/dist/commonjs/models/cost.d.ts +67 -0
  47. package/dist/commonjs/models/cost.d.ts.map +1 -0
  48. package/dist/commonjs/models/cost.js +89 -0
  49. package/dist/commonjs/models/cost.js.map +1 -0
  50. package/dist/commonjs/models/costusageresponse.d.ts +69 -0
  51. package/dist/commonjs/models/costusageresponse.d.ts.map +1 -0
  52. package/dist/commonjs/models/costusageresponse.js +91 -0
  53. package/dist/commonjs/models/costusageresponse.js.map +1 -0
  54. package/dist/commonjs/models/entitlementaccessresult.d.ts +20 -0
  55. package/dist/commonjs/models/entitlementaccessresult.d.ts.map +1 -1
  56. package/dist/commonjs/models/entitlementaccessresult.js +5 -0
  57. package/dist/commonjs/models/entitlementaccessresult.js.map +1 -1
  58. package/dist/commonjs/models/grant.d.ts +8 -0
  59. package/dist/commonjs/models/grant.d.ts.map +1 -1
  60. package/dist/commonjs/models/grant.js +2 -0
  61. package/dist/commonjs/models/grant.js.map +1 -1
  62. package/dist/commonjs/models/index.d.ts +4 -0
  63. package/dist/commonjs/models/index.d.ts.map +1 -1
  64. package/dist/commonjs/models/index.js +4 -0
  65. package/dist/commonjs/models/index.js.map +1 -1
  66. package/dist/commonjs/models/invoicelineitem.d.ts +4 -3
  67. package/dist/commonjs/models/invoicelineitem.d.ts.map +1 -1
  68. package/dist/commonjs/models/invoicelineitem.js +2 -1
  69. package/dist/commonjs/models/invoicelineitem.js.map +1 -1
  70. package/dist/commonjs/models/lineitem.d.ts +4 -3
  71. package/dist/commonjs/models/lineitem.d.ts.map +1 -1
  72. package/dist/commonjs/models/lineitem.js +2 -1
  73. package/dist/commonjs/models/lineitem.js.map +1 -1
  74. package/dist/commonjs/models/meterevent.d.ts +47 -0
  75. package/dist/commonjs/models/meterevent.d.ts.map +1 -0
  76. package/dist/commonjs/models/meterevent.js +62 -0
  77. package/dist/commonjs/models/meterevent.js.map +1 -0
  78. package/dist/commonjs/models/metereventlist.d.ts +28 -0
  79. package/dist/commonjs/models/metereventlist.d.ts.map +1 -0
  80. package/dist/commonjs/models/metereventlist.js +60 -0
  81. package/dist/commonjs/models/metereventlist.js.map +1 -0
  82. package/dist/commonjs/models/operations/createbillablemetric.d.ts +4 -4
  83. package/dist/commonjs/models/operations/createbillablemetric.d.ts.map +1 -1
  84. package/dist/commonjs/models/operations/createbillablemetric.js +4 -5
  85. package/dist/commonjs/models/operations/createbillablemetric.js.map +1 -1
  86. package/dist/commonjs/models/operations/createcost.d.ts +100 -0
  87. package/dist/commonjs/models/operations/createcost.d.ts.map +1 -0
  88. package/dist/commonjs/models/operations/createcost.js +81 -0
  89. package/dist/commonjs/models/operations/createcost.js.map +1 -0
  90. package/dist/commonjs/models/operations/createplan.d.ts +36 -2
  91. package/dist/commonjs/models/operations/createplan.d.ts.map +1 -1
  92. package/dist/commonjs/models/operations/createplan.js +24 -2
  93. package/dist/commonjs/models/operations/createplan.js.map +1 -1
  94. package/dist/commonjs/models/operations/createprice.d.ts +5 -0
  95. package/dist/commonjs/models/operations/createprice.d.ts.map +1 -1
  96. package/dist/commonjs/models/operations/createprice.js +1 -0
  97. package/dist/commonjs/models/operations/createprice.js.map +1 -1
  98. package/dist/commonjs/models/operations/deletecost.d.ts +15 -0
  99. package/dist/commonjs/models/operations/deletecost.d.ts.map +1 -0
  100. package/dist/commonjs/models/operations/deletecost.js +49 -0
  101. package/dist/commonjs/models/operations/deletecost.js.map +1 -0
  102. package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts +1 -0
  103. package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts.map +1 -1
  104. package/dist/commonjs/models/operations/getbillablemetricmeter.js +1 -0
  105. package/dist/commonjs/models/operations/getbillablemetricmeter.js.map +1 -1
  106. package/dist/commonjs/models/operations/getcost.d.ts +15 -0
  107. package/dist/commonjs/models/operations/getcost.d.ts.map +1 -0
  108. package/dist/commonjs/models/operations/getcost.js +49 -0
  109. package/dist/commonjs/models/operations/getcost.js.map +1 -0
  110. package/dist/commonjs/models/operations/getcostsummary.d.ts +60 -0
  111. package/dist/commonjs/models/operations/getcostsummary.d.ts.map +1 -0
  112. package/dist/commonjs/models/operations/getcostsummary.js +66 -0
  113. package/dist/commonjs/models/operations/getcostsummary.js.map +1 -0
  114. package/dist/commonjs/models/operations/getentitlement.d.ts +5 -0
  115. package/dist/commonjs/models/operations/getentitlement.d.ts.map +1 -1
  116. package/dist/commonjs/models/operations/getentitlement.js +1 -0
  117. package/dist/commonjs/models/operations/getentitlement.js.map +1 -1
  118. package/dist/commonjs/models/operations/index.d.ts +7 -0
  119. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  120. package/dist/commonjs/models/operations/index.js +7 -0
  121. package/dist/commonjs/models/operations/index.js.map +1 -1
  122. package/dist/commonjs/models/operations/listbillablemetricevents.d.ts +37 -0
  123. package/dist/commonjs/models/operations/listbillablemetricevents.d.ts.map +1 -0
  124. package/dist/commonjs/models/operations/listbillablemetricevents.js +54 -0
  125. package/dist/commonjs/models/operations/listbillablemetricevents.js.map +1 -0
  126. package/dist/commonjs/models/operations/listcosts.d.ts +59 -0
  127. package/dist/commonjs/models/operations/listcosts.d.ts.map +1 -0
  128. package/dist/commonjs/models/operations/listcosts.js +79 -0
  129. package/dist/commonjs/models/operations/listcosts.js.map +1 -0
  130. package/dist/commonjs/models/operations/listentitlements.d.ts +5 -0
  131. package/dist/commonjs/models/operations/listentitlements.d.ts.map +1 -1
  132. package/dist/commonjs/models/operations/listentitlements.js +1 -0
  133. package/dist/commonjs/models/operations/listentitlements.js.map +1 -1
  134. package/dist/commonjs/models/operations/updatecost.d.ts +88 -0
  135. package/dist/commonjs/models/operations/updatecost.d.ts.map +1 -0
  136. package/dist/commonjs/models/operations/updatecost.js +84 -0
  137. package/dist/commonjs/models/operations/updatecost.js.map +1 -0
  138. package/dist/commonjs/models/operations/updateplan.d.ts +36 -2
  139. package/dist/commonjs/models/operations/updateplan.d.ts.map +1 -1
  140. package/dist/commonjs/models/operations/updateplan.js +24 -2
  141. package/dist/commonjs/models/operations/updateplan.js.map +1 -1
  142. package/dist/commonjs/models/operations/updateprice.d.ts +5 -0
  143. package/dist/commonjs/models/operations/updateprice.d.ts.map +1 -1
  144. package/dist/commonjs/models/operations/updateprice.js +1 -0
  145. package/dist/commonjs/models/operations/updateprice.js.map +1 -1
  146. package/dist/commonjs/models/plan.d.ts +23 -0
  147. package/dist/commonjs/models/plan.d.ts.map +1 -1
  148. package/dist/commonjs/models/plan.js +12 -1
  149. package/dist/commonjs/models/plan.js.map +1 -1
  150. package/dist/commonjs/models/price.d.ts +4 -0
  151. package/dist/commonjs/models/price.d.ts.map +1 -1
  152. package/dist/commonjs/models/price.js +1 -0
  153. package/dist/commonjs/models/price.js.map +1 -1
  154. package/dist/commonjs/models/schemasprice.d.ts +4 -0
  155. package/dist/commonjs/models/schemasprice.d.ts.map +1 -1
  156. package/dist/commonjs/models/schemasprice.js +1 -0
  157. package/dist/commonjs/models/schemasprice.js.map +1 -1
  158. package/dist/commonjs/models/subscription.d.ts +22 -2
  159. package/dist/commonjs/models/subscription.d.ts.map +1 -1
  160. package/dist/commonjs/models/subscription.js +13 -1
  161. package/dist/commonjs/models/subscription.js.map +1 -1
  162. package/dist/commonjs/sdk/billablemetrics.d.ts +7 -0
  163. package/dist/commonjs/sdk/billablemetrics.d.ts.map +1 -1
  164. package/dist/commonjs/sdk/billablemetrics.js +10 -0
  165. package/dist/commonjs/sdk/billablemetrics.js.map +1 -1
  166. package/dist/commonjs/sdk/costs.d.ts +36 -0
  167. package/dist/commonjs/sdk/costs.d.ts.map +1 -0
  168. package/dist/commonjs/sdk/costs.js +60 -0
  169. package/dist/commonjs/sdk/costs.js.map +1 -0
  170. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  171. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  172. package/dist/commonjs/sdk/sdk.js +4 -0
  173. package/dist/commonjs/sdk/sdk.js.map +1 -1
  174. package/dist/esm/funcs/billableMetricsListEvents.d.ts +19 -0
  175. package/dist/esm/funcs/billableMetricsListEvents.d.ts.map +1 -0
  176. package/dist/esm/funcs/billableMetricsListEvents.js +96 -0
  177. package/dist/esm/funcs/billableMetricsListEvents.js.map +1 -0
  178. package/dist/esm/funcs/costsCreateCost.d.ts +19 -0
  179. package/dist/esm/funcs/costsCreateCost.d.ts.map +1 -0
  180. package/dist/esm/funcs/costsCreateCost.js +83 -0
  181. package/dist/esm/funcs/costsCreateCost.js.map +1 -0
  182. package/dist/esm/funcs/costsDeleteCost.d.ts +15 -0
  183. package/dist/esm/funcs/costsDeleteCost.d.ts.map +1 -0
  184. package/dist/esm/funcs/costsDeleteCost.js +85 -0
  185. package/dist/esm/funcs/costsDeleteCost.js.map +1 -0
  186. package/dist/esm/funcs/costsGetCost.d.ts +16 -0
  187. package/dist/esm/funcs/costsGetCost.d.ts.map +1 -0
  188. package/dist/esm/funcs/costsGetCost.js +85 -0
  189. package/dist/esm/funcs/costsGetCost.js.map +1 -0
  190. package/dist/esm/funcs/costsGetCostSummary.d.ts +19 -0
  191. package/dist/esm/funcs/costsGetCostSummary.d.ts.map +1 -0
  192. package/dist/esm/funcs/costsGetCostSummary.js +97 -0
  193. package/dist/esm/funcs/costsGetCostSummary.js.map +1 -0
  194. package/dist/esm/funcs/costsListCosts.d.ts +15 -0
  195. package/dist/esm/funcs/costsListCosts.d.ts.map +1 -0
  196. package/dist/esm/funcs/costsListCosts.js +85 -0
  197. package/dist/esm/funcs/costsListCosts.js.map +1 -0
  198. package/dist/esm/funcs/costsUpdateCost.d.ts +16 -0
  199. package/dist/esm/funcs/costsUpdateCost.d.ts.map +1 -0
  200. package/dist/esm/funcs/costsUpdateCost.js +86 -0
  201. package/dist/esm/funcs/costsUpdateCost.js.map +1 -0
  202. package/dist/esm/funcs/entitlementsGet.js +5 -1
  203. package/dist/esm/funcs/entitlementsGet.js.map +1 -1
  204. package/dist/esm/funcs/entitlementsList.js +1 -0
  205. package/dist/esm/funcs/entitlementsList.js.map +1 -1
  206. package/dist/esm/lib/config.d.ts +3 -3
  207. package/dist/esm/lib/config.js +3 -3
  208. package/dist/esm/lib/config.js.map +1 -1
  209. package/dist/esm/lib/encodings.d.ts +1 -0
  210. package/dist/esm/lib/encodings.d.ts.map +1 -1
  211. package/dist/esm/lib/encodings.js +6 -0
  212. package/dist/esm/lib/encodings.js.map +1 -1
  213. package/dist/esm/models/billablemetric.d.ts +4 -4
  214. package/dist/esm/models/billablemetric.d.ts.map +1 -1
  215. package/dist/esm/models/billablemetric.js +3 -4
  216. package/dist/esm/models/billablemetric.js.map +1 -1
  217. package/dist/esm/models/cost.d.ts +67 -0
  218. package/dist/esm/models/cost.d.ts.map +1 -0
  219. package/dist/esm/models/cost.js +52 -0
  220. package/dist/esm/models/cost.js.map +1 -0
  221. package/dist/esm/models/costusageresponse.d.ts +69 -0
  222. package/dist/esm/models/costusageresponse.d.ts.map +1 -0
  223. package/dist/esm/models/costusageresponse.js +52 -0
  224. package/dist/esm/models/costusageresponse.js.map +1 -0
  225. package/dist/esm/models/entitlementaccessresult.d.ts +20 -0
  226. package/dist/esm/models/entitlementaccessresult.d.ts.map +1 -1
  227. package/dist/esm/models/entitlementaccessresult.js +5 -0
  228. package/dist/esm/models/entitlementaccessresult.js.map +1 -1
  229. package/dist/esm/models/grant.d.ts +8 -0
  230. package/dist/esm/models/grant.d.ts.map +1 -1
  231. package/dist/esm/models/grant.js +2 -0
  232. package/dist/esm/models/grant.js.map +1 -1
  233. package/dist/esm/models/index.d.ts +4 -0
  234. package/dist/esm/models/index.d.ts.map +1 -1
  235. package/dist/esm/models/index.js +4 -0
  236. package/dist/esm/models/index.js.map +1 -1
  237. package/dist/esm/models/invoicelineitem.d.ts +4 -3
  238. package/dist/esm/models/invoicelineitem.d.ts.map +1 -1
  239. package/dist/esm/models/invoicelineitem.js +2 -1
  240. package/dist/esm/models/invoicelineitem.js.map +1 -1
  241. package/dist/esm/models/lineitem.d.ts +4 -3
  242. package/dist/esm/models/lineitem.d.ts.map +1 -1
  243. package/dist/esm/models/lineitem.js +2 -1
  244. package/dist/esm/models/lineitem.js.map +1 -1
  245. package/dist/esm/models/meterevent.d.ts +47 -0
  246. package/dist/esm/models/meterevent.d.ts.map +1 -0
  247. package/dist/esm/models/meterevent.js +25 -0
  248. package/dist/esm/models/meterevent.js.map +1 -0
  249. package/dist/esm/models/metereventlist.d.ts +28 -0
  250. package/dist/esm/models/metereventlist.d.ts.map +1 -0
  251. package/dist/esm/models/metereventlist.js +23 -0
  252. package/dist/esm/models/metereventlist.js.map +1 -0
  253. package/dist/esm/models/operations/createbillablemetric.d.ts +4 -4
  254. package/dist/esm/models/operations/createbillablemetric.d.ts.map +1 -1
  255. package/dist/esm/models/operations/createbillablemetric.js +3 -4
  256. package/dist/esm/models/operations/createbillablemetric.js.map +1 -1
  257. package/dist/esm/models/operations/createcost.d.ts +100 -0
  258. package/dist/esm/models/operations/createcost.d.ts.map +1 -0
  259. package/dist/esm/models/operations/createcost.js +44 -0
  260. package/dist/esm/models/operations/createcost.js.map +1 -0
  261. package/dist/esm/models/operations/createplan.d.ts +36 -2
  262. package/dist/esm/models/operations/createplan.d.ts.map +1 -1
  263. package/dist/esm/models/operations/createplan.js +23 -1
  264. package/dist/esm/models/operations/createplan.js.map +1 -1
  265. package/dist/esm/models/operations/createprice.d.ts +5 -0
  266. package/dist/esm/models/operations/createprice.d.ts.map +1 -1
  267. package/dist/esm/models/operations/createprice.js +1 -0
  268. package/dist/esm/models/operations/createprice.js.map +1 -1
  269. package/dist/esm/models/operations/deletecost.d.ts +15 -0
  270. package/dist/esm/models/operations/deletecost.d.ts.map +1 -0
  271. package/dist/esm/models/operations/deletecost.js +12 -0
  272. package/dist/esm/models/operations/deletecost.js.map +1 -0
  273. package/dist/esm/models/operations/getbillablemetricmeter.d.ts +1 -0
  274. package/dist/esm/models/operations/getbillablemetricmeter.d.ts.map +1 -1
  275. package/dist/esm/models/operations/getbillablemetricmeter.js +1 -0
  276. package/dist/esm/models/operations/getbillablemetricmeter.js.map +1 -1
  277. package/dist/esm/models/operations/getcost.d.ts +15 -0
  278. package/dist/esm/models/operations/getcost.d.ts.map +1 -0
  279. package/dist/esm/models/operations/getcost.js +12 -0
  280. package/dist/esm/models/operations/getcost.js.map +1 -0
  281. package/dist/esm/models/operations/getcostsummary.d.ts +60 -0
  282. package/dist/esm/models/operations/getcostsummary.d.ts.map +1 -0
  283. package/dist/esm/models/operations/getcostsummary.js +29 -0
  284. package/dist/esm/models/operations/getcostsummary.js.map +1 -0
  285. package/dist/esm/models/operations/getentitlement.d.ts +5 -0
  286. package/dist/esm/models/operations/getentitlement.d.ts.map +1 -1
  287. package/dist/esm/models/operations/getentitlement.js +1 -0
  288. package/dist/esm/models/operations/getentitlement.js.map +1 -1
  289. package/dist/esm/models/operations/index.d.ts +7 -0
  290. package/dist/esm/models/operations/index.d.ts.map +1 -1
  291. package/dist/esm/models/operations/index.js +7 -0
  292. package/dist/esm/models/operations/index.js.map +1 -1
  293. package/dist/esm/models/operations/listbillablemetricevents.d.ts +37 -0
  294. package/dist/esm/models/operations/listbillablemetricevents.d.ts.map +1 -0
  295. package/dist/esm/models/operations/listbillablemetricevents.js +17 -0
  296. package/dist/esm/models/operations/listbillablemetricevents.js.map +1 -0
  297. package/dist/esm/models/operations/listcosts.d.ts +59 -0
  298. package/dist/esm/models/operations/listcosts.d.ts.map +1 -0
  299. package/dist/esm/models/operations/listcosts.js +40 -0
  300. package/dist/esm/models/operations/listcosts.js.map +1 -0
  301. package/dist/esm/models/operations/listentitlements.d.ts +5 -0
  302. package/dist/esm/models/operations/listentitlements.d.ts.map +1 -1
  303. package/dist/esm/models/operations/listentitlements.js +1 -0
  304. package/dist/esm/models/operations/listentitlements.js.map +1 -1
  305. package/dist/esm/models/operations/updatecost.d.ts +88 -0
  306. package/dist/esm/models/operations/updatecost.d.ts.map +1 -0
  307. package/dist/esm/models/operations/updatecost.js +46 -0
  308. package/dist/esm/models/operations/updatecost.js.map +1 -0
  309. package/dist/esm/models/operations/updateplan.d.ts +36 -2
  310. package/dist/esm/models/operations/updateplan.d.ts.map +1 -1
  311. package/dist/esm/models/operations/updateplan.js +23 -1
  312. package/dist/esm/models/operations/updateplan.js.map +1 -1
  313. package/dist/esm/models/operations/updateprice.d.ts +5 -0
  314. package/dist/esm/models/operations/updateprice.d.ts.map +1 -1
  315. package/dist/esm/models/operations/updateprice.js +1 -0
  316. package/dist/esm/models/operations/updateprice.js.map +1 -1
  317. package/dist/esm/models/plan.d.ts +23 -0
  318. package/dist/esm/models/plan.d.ts.map +1 -1
  319. package/dist/esm/models/plan.js +11 -0
  320. package/dist/esm/models/plan.js.map +1 -1
  321. package/dist/esm/models/price.d.ts +4 -0
  322. package/dist/esm/models/price.d.ts.map +1 -1
  323. package/dist/esm/models/price.js +1 -0
  324. package/dist/esm/models/price.js.map +1 -1
  325. package/dist/esm/models/schemasprice.d.ts +4 -0
  326. package/dist/esm/models/schemasprice.d.ts.map +1 -1
  327. package/dist/esm/models/schemasprice.js +1 -0
  328. package/dist/esm/models/schemasprice.js.map +1 -1
  329. package/dist/esm/models/subscription.d.ts +22 -2
  330. package/dist/esm/models/subscription.d.ts.map +1 -1
  331. package/dist/esm/models/subscription.js +11 -0
  332. package/dist/esm/models/subscription.js.map +1 -1
  333. package/dist/esm/sdk/billablemetrics.d.ts +7 -0
  334. package/dist/esm/sdk/billablemetrics.d.ts.map +1 -1
  335. package/dist/esm/sdk/billablemetrics.js +10 -0
  336. package/dist/esm/sdk/billablemetrics.js.map +1 -1
  337. package/dist/esm/sdk/costs.d.ts +36 -0
  338. package/dist/esm/sdk/costs.d.ts.map +1 -0
  339. package/dist/esm/sdk/costs.js +56 -0
  340. package/dist/esm/sdk/costs.js.map +1 -0
  341. package/dist/esm/sdk/sdk.d.ts +3 -0
  342. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  343. package/dist/esm/sdk/sdk.js +4 -0
  344. package/dist/esm/sdk/sdk.js.map +1 -1
  345. package/examples/customersCreate.example.ts +37 -0
  346. package/jsr.json +6 -4
  347. package/package.json +1 -1
  348. package/src/funcs/billableMetricsListEvents.ts +190 -0
  349. package/src/funcs/costsCreateCost.ts +175 -0
  350. package/src/funcs/costsDeleteCost.ts +173 -0
  351. package/src/funcs/costsGetCost.ts +173 -0
  352. package/src/funcs/costsGetCostSummary.ts +190 -0
  353. package/src/funcs/costsListCosts.ts +175 -0
  354. package/src/funcs/costsUpdateCost.ts +178 -0
  355. package/src/funcs/entitlementsGet.ts +6 -1
  356. package/src/funcs/entitlementsList.ts +1 -0
  357. package/src/lib/config.ts +3 -3
  358. package/src/lib/encodings.ts +9 -0
  359. package/src/models/billablemetric.ts +9 -6
  360. package/src/models/cost.ts +114 -0
  361. package/src/models/costusageresponse.ts +145 -0
  362. package/src/models/entitlementaccessresult.ts +29 -0
  363. package/src/models/grant.ts +10 -0
  364. package/src/models/index.ts +4 -0
  365. package/src/models/invoicelineitem.ts +4 -3
  366. package/src/models/lineitem.ts +4 -3
  367. package/src/models/meterevent.ts +77 -0
  368. package/src/models/metereventlist.ts +59 -0
  369. package/src/models/operations/createbillablemetric.ts +9 -6
  370. package/src/models/operations/createcost.ts +133 -0
  371. package/src/models/operations/createplan.ts +50 -3
  372. package/src/models/operations/createprice.ts +6 -0
  373. package/src/models/operations/deletecost.ts +34 -0
  374. package/src/models/operations/getbillablemetricmeter.ts +1 -0
  375. package/src/models/operations/getcost.ts +30 -0
  376. package/src/models/operations/getcostsummary.ts +88 -0
  377. package/src/models/operations/getentitlement.ts +6 -0
  378. package/src/models/operations/index.ts +7 -0
  379. package/src/models/operations/listbillablemetricevents.ts +63 -0
  380. package/src/models/operations/listcosts.ts +124 -0
  381. package/src/models/operations/listentitlements.ts +6 -0
  382. package/src/models/operations/updatecost.ts +136 -0
  383. package/src/models/operations/updateplan.ts +50 -3
  384. package/src/models/operations/updateprice.ts +6 -0
  385. package/src/models/plan.ts +28 -0
  386. package/src/models/price.ts +5 -0
  387. package/src/models/schemasprice.ts +5 -0
  388. package/src/models/subscription.ts +46 -2
  389. package/src/sdk/billablemetrics.ts +18 -0
  390. package/src/sdk/costs.ts +106 -0
  391. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,136 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+
9
+ /**
10
+ * Updated aggregation method (metered costs only).
11
+ */
12
+ export const UpdateCostAggregation = {
13
+ Sum: "SUM",
14
+ Count: "COUNT",
15
+ Avg: "AVG",
16
+ Min: "MIN",
17
+ Max: "MAX",
18
+ UniqueCount: "UNIQUE_COUNT",
19
+ Latest: "LATEST",
20
+ } as const;
21
+ /**
22
+ * Updated aggregation method (metered costs only).
23
+ */
24
+ export type UpdateCostAggregation = ClosedEnum<typeof UpdateCostAggregation>;
25
+
26
+ export type UpdateCostRequestBody = {
27
+ /**
28
+ * Updated name for the cost.
29
+ */
30
+ name?: string | undefined;
31
+ /**
32
+ * Updated unit cost.
33
+ */
34
+ unitCost?: number | undefined;
35
+ /**
36
+ * Updated ISO 4217 currency code.
37
+ */
38
+ currency?: string | undefined;
39
+ /**
40
+ * Updated unit label (metered costs only).
41
+ */
42
+ unit?: string | null | undefined;
43
+ /**
44
+ * Updated aggregation method (metered costs only).
45
+ */
46
+ aggregation?: UpdateCostAggregation | null | undefined;
47
+ /**
48
+ * Updated CloudEvents type (metered costs only).
49
+ */
50
+ eventType?: string | null | undefined;
51
+ /**
52
+ * Updated JSONPath for value extraction (metered costs only).
53
+ */
54
+ valueProperty?: string | null | undefined;
55
+ /**
56
+ * Updated group-by dimension map (metered costs only).
57
+ */
58
+ groupBy?: { [k: string]: string } | null | undefined;
59
+ };
60
+
61
+ export type UpdateCostRequest = {
62
+ /**
63
+ * The unique identifier of the cost
64
+ */
65
+ id: string;
66
+ requestBody: UpdateCostRequestBody;
67
+ };
68
+
69
+ /** @internal */
70
+ export const UpdateCostAggregation$outboundSchema: z.ZodNativeEnum<
71
+ typeof UpdateCostAggregation
72
+ > = z.nativeEnum(UpdateCostAggregation);
73
+
74
+ /** @internal */
75
+ export type UpdateCostRequestBody$Outbound = {
76
+ name?: string | undefined;
77
+ unitCost?: number | undefined;
78
+ currency?: string | undefined;
79
+ unit?: string | null | undefined;
80
+ aggregation?: string | null | undefined;
81
+ eventType?: string | null | undefined;
82
+ valueProperty?: string | null | undefined;
83
+ groupBy?: { [k: string]: string } | null | undefined;
84
+ };
85
+
86
+ /** @internal */
87
+ export const UpdateCostRequestBody$outboundSchema: z.ZodType<
88
+ UpdateCostRequestBody$Outbound,
89
+ z.ZodTypeDef,
90
+ UpdateCostRequestBody
91
+ > = z.object({
92
+ name: z.string().optional(),
93
+ unitCost: z.number().optional(),
94
+ currency: z.string().optional(),
95
+ unit: z.nullable(z.string()).optional(),
96
+ aggregation: z.nullable(UpdateCostAggregation$outboundSchema).optional(),
97
+ eventType: z.nullable(z.string()).optional(),
98
+ valueProperty: z.nullable(z.string()).optional(),
99
+ groupBy: z.nullable(z.record(z.string())).optional(),
100
+ });
101
+
102
+ export function updateCostRequestBodyToJSON(
103
+ updateCostRequestBody: UpdateCostRequestBody,
104
+ ): string {
105
+ return JSON.stringify(
106
+ UpdateCostRequestBody$outboundSchema.parse(updateCostRequestBody),
107
+ );
108
+ }
109
+
110
+ /** @internal */
111
+ export type UpdateCostRequest$Outbound = {
112
+ id: string;
113
+ RequestBody: UpdateCostRequestBody$Outbound;
114
+ };
115
+
116
+ /** @internal */
117
+ export const UpdateCostRequest$outboundSchema: z.ZodType<
118
+ UpdateCostRequest$Outbound,
119
+ z.ZodTypeDef,
120
+ UpdateCostRequest
121
+ > = z.object({
122
+ id: z.string(),
123
+ requestBody: z.lazy(() => UpdateCostRequestBody$outboundSchema),
124
+ }).transform((v) => {
125
+ return remap$(v, {
126
+ requestBody: "RequestBody",
127
+ });
128
+ });
129
+
130
+ export function updateCostRequestToJSON(
131
+ updateCostRequest: UpdateCostRequest,
132
+ ): string {
133
+ return JSON.stringify(
134
+ UpdateCostRequest$outboundSchema.parse(updateCostRequest),
135
+ );
136
+ }
@@ -6,6 +6,37 @@ import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { ClosedEnum } from "../../types/enums.js";
8
8
 
9
+ /**
10
+ * ISO 8601 duration for the billing period. Takes precedence over billingInterval when both are provided.
11
+ */
12
+ export const UpdatePlanBillingCadence = {
13
+ P1M: "P1M",
14
+ P3M: "P3M",
15
+ P1Y: "P1Y",
16
+ } as const;
17
+ /**
18
+ * ISO 8601 duration for the billing period. Takes precedence over billingInterval when both are provided.
19
+ */
20
+ export type UpdatePlanBillingCadence = ClosedEnum<
21
+ typeof UpdatePlanBillingCadence
22
+ >;
23
+
24
+ /**
25
+ * Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'quarterly' for quarterly billing, 'yearly' for annual billing
26
+ */
27
+ export const UpdatePlanBillingInterval = {
28
+ Monthly: "monthly",
29
+ Quarterly: "quarterly",
30
+ Yearly: "yearly",
31
+ Annual: "annual",
32
+ } as const;
33
+ /**
34
+ * Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'quarterly' for quarterly billing, 'yearly' for annual billing
35
+ */
36
+ export type UpdatePlanBillingInterval = ClosedEnum<
37
+ typeof UpdatePlanBillingInterval
38
+ >;
39
+
9
40
  /**
10
41
  * Whether tax is added on top of the price (exclusive) or included in the price (inclusive)
11
42
  */
@@ -20,9 +51,13 @@ export type UpdatePlanTaxBehavior = ClosedEnum<typeof UpdatePlanTaxBehavior>;
20
51
 
21
52
  export type UpdatePlanRequestBody = {
22
53
  /**
23
- * Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'yearly' for annual billing, 'weekly' for weekly billing
54
+ * ISO 8601 duration for the billing period. Takes precedence over billingInterval when both are provided.
24
55
  */
25
- billingInterval?: string | undefined;
56
+ billingCadence?: UpdatePlanBillingCadence | undefined;
57
+ /**
58
+ * Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'quarterly' for quarterly billing, 'yearly' for annual billing
59
+ */
60
+ billingInterval?: UpdatePlanBillingInterval | undefined;
26
61
  /**
27
62
  * Default tax code for plan line items. Common values: 'eservice' (electronically supplied services), 'saas' (software as a service), 'consulting', 'ebook', 'standard', 'reduced', 'exempt'. Full list available via GET /tax/codes endpoint.
28
63
  */
@@ -69,6 +104,16 @@ export type UpdatePlanRequest = {
69
104
  requestBody: UpdatePlanRequestBody;
70
105
  };
71
106
 
107
+ /** @internal */
108
+ export const UpdatePlanBillingCadence$outboundSchema: z.ZodNativeEnum<
109
+ typeof UpdatePlanBillingCadence
110
+ > = z.nativeEnum(UpdatePlanBillingCadence);
111
+
112
+ /** @internal */
113
+ export const UpdatePlanBillingInterval$outboundSchema: z.ZodNativeEnum<
114
+ typeof UpdatePlanBillingInterval
115
+ > = z.nativeEnum(UpdatePlanBillingInterval);
116
+
72
117
  /** @internal */
73
118
  export const UpdatePlanTaxBehavior$outboundSchema: z.ZodNativeEnum<
74
119
  typeof UpdatePlanTaxBehavior
@@ -76,6 +121,7 @@ export const UpdatePlanTaxBehavior$outboundSchema: z.ZodNativeEnum<
76
121
 
77
122
  /** @internal */
78
123
  export type UpdatePlanRequestBody$Outbound = {
124
+ billingCadence?: string | undefined;
79
125
  billingInterval?: string | undefined;
80
126
  defaultTaxCode?: string | undefined;
81
127
  defaultTaxRate?: number | undefined;
@@ -94,7 +140,8 @@ export const UpdatePlanRequestBody$outboundSchema: z.ZodType<
94
140
  z.ZodTypeDef,
95
141
  UpdatePlanRequestBody
96
142
  > = z.object({
97
- billingInterval: z.string().optional(),
143
+ billingCadence: UpdatePlanBillingCadence$outboundSchema.optional(),
144
+ billingInterval: UpdatePlanBillingInterval$outboundSchema.optional(),
98
145
  defaultTaxCode: z.string().optional(),
99
146
  defaultTaxRate: z.number().optional(),
100
147
  description: z.string().optional(),
@@ -60,6 +60,10 @@ export type UpdatePriceRequestBody = {
60
60
  * Feature to associate. Set to null to remove existing feature. Omit to leave unchanged.
61
61
  */
62
62
  feature?: models.PriceFeatureInput | null | undefined;
63
+ /**
64
+ * When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
65
+ */
66
+ grantDiscountEnabled?: boolean | undefined;
63
67
  };
64
68
 
65
69
  export type UpdatePriceRequest = {
@@ -89,6 +93,7 @@ export type UpdatePriceRequestBody$Outbound = {
89
93
  paymentTerm?: string | undefined;
90
94
  billingCadence?: string | null | undefined;
91
95
  feature?: models.PriceFeatureInput$Outbound | null | undefined;
96
+ grantDiscountEnabled?: boolean | undefined;
92
97
  };
93
98
 
94
99
  /** @internal */
@@ -104,6 +109,7 @@ export const UpdatePriceRequestBody$outboundSchema: z.ZodType<
104
109
  paymentTerm: UpdatePricePaymentTerm$outboundSchema.optional(),
105
110
  billingCadence: z.nullable(z.string()).optional(),
106
111
  feature: z.nullable(models.PriceFeatureInput$outboundSchema).optional(),
112
+ grantDiscountEnabled: z.boolean().optional(),
107
113
  });
108
114
 
109
115
  export function updatePriceRequestBodyToJSON(
@@ -15,6 +15,19 @@ export const PlanObject = {
15
15
  } as const;
16
16
  export type PlanObject = ClosedEnum<typeof PlanObject>;
17
17
 
18
+ /**
19
+ * ISO 8601 duration for the billing period.
20
+ */
21
+ export const BillingCadence = {
22
+ P1M: "P1M",
23
+ P3M: "P3M",
24
+ P1Y: "P1Y",
25
+ } as const;
26
+ /**
27
+ * ISO 8601 duration for the billing period.
28
+ */
29
+ export type BillingCadence = ClosedEnum<typeof BillingCadence>;
30
+
18
31
  export type PlanPaymentTerm = {
19
32
  inArrears?: boolean | undefined;
20
33
  instant?: boolean | undefined;
@@ -38,6 +51,15 @@ export type Plan = {
38
51
  */
39
52
  id: string;
40
53
  object: PlanObject;
54
+ /**
55
+ * ISO 8601 duration for the billing period.
56
+ */
57
+ billingCadence: BillingCadence;
58
+ /**
59
+ * Deprecated. Human-readable billing period derived from billingCadence. Use billingCadence instead.
60
+ *
61
+ * @deprecated field: Use billingCadence (ISO 8601 duration: P1M, P3M, P1Y) instead..
62
+ */
41
63
  billingInterval: string;
42
64
  createdAt: Date;
43
65
  currency: string;
@@ -90,6 +112,11 @@ export type Plan = {
90
112
  export const PlanObject$inboundSchema: z.ZodNativeEnum<typeof PlanObject> = z
91
113
  .nativeEnum(PlanObject);
92
114
 
115
+ /** @internal */
116
+ export const BillingCadence$inboundSchema: z.ZodNativeEnum<
117
+ typeof BillingCadence
118
+ > = z.nativeEnum(BillingCadence);
119
+
93
120
  /** @internal */
94
121
  export const PlanPaymentTerm$inboundSchema: z.ZodType<
95
122
  PlanPaymentTerm,
@@ -123,6 +150,7 @@ export const Plan$inboundSchema: z.ZodType<Plan, z.ZodTypeDef, unknown> = z
123
150
  .object({
124
151
  id: z.string(),
125
152
  object: PlanObject$inboundSchema,
153
+ billingCadence: BillingCadence$inboundSchema.default("P1M"),
126
154
  billingInterval: z.string(),
127
155
  createdAt: z.string().datetime({ offset: true }).transform(v =>
128
156
  new Date(v)
@@ -57,6 +57,10 @@ export type Price = {
57
57
  * Features associated with this price
58
58
  */
59
59
  features?: Array<PriceFeature> | undefined;
60
+ /**
61
+ * When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
62
+ */
63
+ grantDiscountEnabled: boolean;
60
64
  };
61
65
 
62
66
  /** @internal */
@@ -94,6 +98,7 @@ export const Price$inboundSchema: z.ZodType<Price, z.ZodTypeDef, unknown> = z
94
98
  new Date(v)
95
99
  ),
96
100
  features: z.array(PriceFeature$inboundSchema).optional(),
101
+ grantDiscountEnabled: z.boolean().default(false),
97
102
  });
98
103
 
99
104
  export function priceFromJSON(
@@ -63,6 +63,10 @@ export type SchemasPrice = {
63
63
  * Features associated with this price
64
64
  */
65
65
  features?: Array<PriceFeature> | undefined;
66
+ /**
67
+ * When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
68
+ */
69
+ grantDiscountEnabled: boolean;
66
70
  };
67
71
 
68
72
  /** @internal */
@@ -98,6 +102,7 @@ export const SchemasPrice$inboundSchema: z.ZodType<
98
102
  properties: PricePropertiesUnion$inboundSchema,
99
103
  updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
100
104
  features: z.array(PriceFeature$inboundSchema).optional(),
105
+ grantDiscountEnabled: z.boolean().default(false),
101
106
  });
102
107
 
103
108
  export function schemasPriceFromJSON(
@@ -13,6 +13,24 @@ export const SubscriptionObject = {
13
13
  } as const;
14
14
  export type SubscriptionObject = ClosedEnum<typeof SubscriptionObject>;
15
15
 
16
+ /**
17
+ * Invoice 0 awaiting merchant approval before payment can proceed. The invoice is in DRAFT status with totals calculated. Approval is currently platform-only — do not call PATCH /v2/invoices/{id} with {"trigger": "APPROVE"} from merchant credentials (it will return 403). A merchant-accessible approval endpoint is planned for PAYG-754.
18
+ */
19
+ export type PaymentAwaitingApproval = {
20
+ /**
21
+ * The Invoice 0 id awaiting approval
22
+ */
23
+ invoiceId: string;
24
+ /**
25
+ * Total payment amount in decimal dollar format
26
+ */
27
+ amount: string;
28
+ /**
29
+ * Payment status
30
+ */
31
+ status: "awaiting_approval";
32
+ };
33
+
16
34
  /**
17
35
  * Zero-amount Invoice 0 that completed synchronously to PAID
18
36
  */
@@ -75,7 +93,10 @@ export type PaymentPending = {
75
93
  /**
76
94
  * Payment session details when upfront payment is required, or confirmation of a zero-amount paid invoice
77
95
  */
78
- export type PaymentUnion = PaymentPending | PaymentPaid;
96
+ export type PaymentUnion =
97
+ | PaymentPending
98
+ | PaymentPaid
99
+ | PaymentAwaitingApproval;
79
100
 
80
101
  export const SubscriptionStatusEnum = {
81
102
  PendingPayment: "pending_payment",
@@ -134,7 +155,7 @@ export type Subscription = {
134
155
  /**
135
156
  * Payment session details when upfront payment is required, or confirmation of a zero-amount paid invoice
136
157
  */
137
- payment?: PaymentPending | PaymentPaid | undefined;
158
+ payment?: PaymentPending | PaymentPaid | PaymentAwaitingApproval | undefined;
138
159
  planId: string;
139
160
  /**
140
161
  * @deprecated Use minimumAccountBalance instead. Minimum required wallet balance in atomic units. Sample values: '200000000000' equals $200.00 minimum, '1000000000000' equals $1000.00 minimum
@@ -183,6 +204,27 @@ export const SubscriptionObject$inboundSchema: z.ZodNativeEnum<
183
204
  typeof SubscriptionObject
184
205
  > = z.nativeEnum(SubscriptionObject);
185
206
 
207
+ /** @internal */
208
+ export const PaymentAwaitingApproval$inboundSchema: z.ZodType<
209
+ PaymentAwaitingApproval,
210
+ z.ZodTypeDef,
211
+ unknown
212
+ > = z.object({
213
+ invoiceId: z.string(),
214
+ amount: z.string(),
215
+ status: z.literal("awaiting_approval"),
216
+ });
217
+
218
+ export function paymentAwaitingApprovalFromJSON(
219
+ jsonString: string,
220
+ ): SafeParseResult<PaymentAwaitingApproval, SDKValidationError> {
221
+ return safeParse(
222
+ jsonString,
223
+ (x) => PaymentAwaitingApproval$inboundSchema.parse(JSON.parse(x)),
224
+ `Failed to parse 'PaymentAwaitingApproval' from JSON`,
225
+ );
226
+ }
227
+
186
228
  /** @internal */
187
229
  export const PaymentPaid$inboundSchema: z.ZodType<
188
230
  PaymentPaid,
@@ -256,6 +298,7 @@ export const PaymentUnion$inboundSchema: z.ZodType<
256
298
  > = z.union([
257
299
  z.lazy(() => PaymentPending$inboundSchema),
258
300
  z.lazy(() => PaymentPaid$inboundSchema),
301
+ z.lazy(() => PaymentAwaitingApproval$inboundSchema),
259
302
  ]);
260
303
 
261
304
  export function paymentUnionFromJSON(
@@ -356,6 +399,7 @@ export const Subscription$inboundSchema: z.ZodType<
356
399
  payment: z.union([
357
400
  z.lazy(() => PaymentPending$inboundSchema),
358
401
  z.lazy(() => PaymentPaid$inboundSchema),
402
+ z.lazy(() => PaymentAwaitingApproval$inboundSchema),
359
403
  ]).optional(),
360
404
  planId: z.string(),
361
405
  prefundAmount: z.string().optional(),
@@ -5,6 +5,7 @@
5
5
  import { billableMetricsCreate } from "../funcs/billableMetricsCreate.js";
6
6
  import { billableMetricsGet } from "../funcs/billableMetricsGet.js";
7
7
  import { billableMetricsList } from "../funcs/billableMetricsList.js";
8
+ import { billableMetricsListEvents } from "../funcs/billableMetricsListEvents.js";
8
9
  import { billableMetricsMeter } from "../funcs/billableMetricsMeter.js";
9
10
  import { billableMetricsUpdate } from "../funcs/billableMetricsUpdate.js";
10
11
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
@@ -88,4 +89,21 @@ export class BillableMetrics extends ClientSDK {
88
89
  options,
89
90
  ));
90
91
  }
92
+
93
+ /**
94
+ * List Meter Events
95
+ *
96
+ * @remarks
97
+ * List raw underlying events for a billable metric from the metering service. Returns events ordered by time descending.
98
+ */
99
+ async listEvents(
100
+ request: operations.ListBillableMetricEventsRequest,
101
+ options?: RequestOptions,
102
+ ): Promise<models.MeterEventList> {
103
+ return unwrapAsync(billableMetricsListEvents(
104
+ this,
105
+ request,
106
+ options,
107
+ ));
108
+ }
91
109
  }
@@ -0,0 +1,106 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { costsCreateCost } from "../funcs/costsCreateCost.js";
6
+ import { costsDeleteCost } from "../funcs/costsDeleteCost.js";
7
+ import { costsGetCost } from "../funcs/costsGetCost.js";
8
+ import { costsGetCostSummary } from "../funcs/costsGetCostSummary.js";
9
+ import { costsListCosts } from "../funcs/costsListCosts.js";
10
+ import { costsUpdateCost } from "../funcs/costsUpdateCost.js";
11
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
12
+ import * as models from "../models/index.js";
13
+ import * as operations from "../models/operations/index.js";
14
+ import { unwrapAsync } from "../types/fp.js";
15
+
16
+ export class Costs extends ClientSDK {
17
+ /**
18
+ * Create
19
+ *
20
+ * @remarks
21
+ * Create a new metered cost for a product.
22
+ */
23
+ async createCost(
24
+ request: operations.CreateCostRequest,
25
+ options?: RequestOptions,
26
+ ): Promise<models.Cost> {
27
+ return unwrapAsync(costsCreateCost(
28
+ this,
29
+ request,
30
+ options,
31
+ ));
32
+ }
33
+
34
+ /**
35
+ * List
36
+ */
37
+ async listCosts(
38
+ request?: operations.ListCostsRequest | undefined,
39
+ options?: RequestOptions,
40
+ ): Promise<operations.ListCostsResponse> {
41
+ return unwrapAsync(costsListCosts(
42
+ this,
43
+ request,
44
+ options,
45
+ ));
46
+ }
47
+
48
+ /**
49
+ * Get
50
+ */
51
+ async getCost(
52
+ request: operations.GetCostRequest,
53
+ options?: RequestOptions,
54
+ ): Promise<models.Cost> {
55
+ return unwrapAsync(costsGetCost(
56
+ this,
57
+ request,
58
+ options,
59
+ ));
60
+ }
61
+
62
+ /**
63
+ * Update
64
+ */
65
+ async updateCost(
66
+ request: operations.UpdateCostRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<models.Cost> {
69
+ return unwrapAsync(costsUpdateCost(
70
+ this,
71
+ request,
72
+ options,
73
+ ));
74
+ }
75
+
76
+ /**
77
+ * Delete
78
+ */
79
+ async deleteCost(
80
+ request: operations.DeleteCostRequest,
81
+ options?: RequestOptions,
82
+ ): Promise<void> {
83
+ return unwrapAsync(costsDeleteCost(
84
+ this,
85
+ request,
86
+ options,
87
+ ));
88
+ }
89
+
90
+ /**
91
+ * Query Summary
92
+ *
93
+ * @remarks
94
+ * Query usage data and compute cost for a specific cost configuration. To retrieve summaries for all costs belonging to a merchant, first call listCosts to obtain cost IDs, then call this endpoint in parallel for each ID.
95
+ */
96
+ async getCostSummary(
97
+ request: operations.GetCostSummaryRequest,
98
+ options?: RequestOptions,
99
+ ): Promise<models.CostUsageResponse> {
100
+ return unwrapAsync(costsGetCostSummary(
101
+ this,
102
+ request,
103
+ options,
104
+ ));
105
+ }
106
+ }
package/src/sdk/sdk.ts CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { ClientSDK } from "../lib/sdks.js";
6
6
  import { BillableMetrics } from "./billablemetrics.js";
7
+ import { Costs } from "./costs.js";
7
8
  import { Customers } from "./customers.js";
8
9
  import { Disputes } from "./disputes.js";
9
10
  import { Entitlements } from "./entitlements.js";
@@ -109,6 +110,11 @@ export class Paygentic extends ClientSDK {
109
110
  return (this._events ??= new Events(this._options));
110
111
  }
111
112
 
113
+ private _costs?: Costs;
114
+ get costs(): Costs {
115
+ return (this._costs ??= new Costs(this._options));
116
+ }
117
+
112
118
  private _revenue?: Revenue;
113
119
  get revenue(): Revenue {
114
120
  return (this._revenue ??= new Revenue(this._options));