@paygentic/sdk 0.9.17 → 0.10.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 (292) hide show
  1. package/README.md +10 -7
  2. package/dist/commonjs/funcs/revenueGetRevenueAccounts.d.ts +23 -0
  3. package/dist/commonjs/funcs/revenueGetRevenueAccounts.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/revenueGetRevenueAccounts.js +129 -0
  5. package/dist/commonjs/funcs/revenueGetRevenueAccounts.js.map +1 -0
  6. package/dist/commonjs/lib/config.d.ts +2 -2
  7. package/dist/commonjs/lib/config.js +2 -2
  8. package/dist/commonjs/models/accountfigure.d.ts +20 -0
  9. package/dist/commonjs/models/accountfigure.d.ts.map +1 -0
  10. package/dist/commonjs/models/accountfigure.js +51 -0
  11. package/dist/commonjs/models/accountfigure.js.map +1 -0
  12. package/dist/commonjs/models/authorizationdenialreason.d.ts +17 -0
  13. package/dist/commonjs/models/authorizationdenialreason.d.ts.map +1 -0
  14. package/dist/commonjs/models/authorizationdenialreason.js +51 -0
  15. package/dist/commonjs/models/authorizationdenialreason.js.map +1 -0
  16. package/dist/commonjs/models/errors/error.d.ts +17 -0
  17. package/dist/commonjs/models/errors/error.d.ts.map +1 -1
  18. package/dist/commonjs/models/errors/error.js +8 -0
  19. package/dist/commonjs/models/errors/error.js.map +1 -1
  20. package/dist/commonjs/models/errors/recordinvoicepayment.d.ts +16 -0
  21. package/dist/commonjs/models/errors/recordinvoicepayment.d.ts.map +1 -1
  22. package/dist/commonjs/models/errors/recordinvoicepayment.js +7 -0
  23. package/dist/commonjs/models/errors/recordinvoicepayment.js.map +1 -1
  24. package/dist/commonjs/models/index.d.ts +20 -0
  25. package/dist/commonjs/models/index.d.ts.map +1 -1
  26. package/dist/commonjs/models/index.js +20 -0
  27. package/dist/commonjs/models/index.js.map +1 -1
  28. package/dist/commonjs/models/invoicelineitem.d.ts +5 -0
  29. package/dist/commonjs/models/invoicelineitem.d.ts.map +1 -1
  30. package/dist/commonjs/models/invoicelineitem.js +2 -0
  31. package/dist/commonjs/models/invoicelineitem.js.map +1 -1
  32. package/dist/commonjs/models/linecalculationcontribution.d.ts +12 -0
  33. package/dist/commonjs/models/linecalculationcontribution.d.ts.map +1 -0
  34. package/dist/commonjs/models/linecalculationcontribution.js +52 -0
  35. package/dist/commonjs/models/linecalculationcontribution.js.map +1 -0
  36. package/dist/commonjs/models/linecalculationgiven.d.ts +20 -0
  37. package/dist/commonjs/models/linecalculationgiven.d.ts.map +1 -0
  38. package/dist/commonjs/models/linecalculationgiven.js +51 -0
  39. package/dist/commonjs/models/linecalculationgiven.js.map +1 -0
  40. package/dist/commonjs/models/linecalculationinputprice.d.ts +21 -0
  41. package/dist/commonjs/models/linecalculationinputprice.d.ts.map +1 -0
  42. package/dist/commonjs/models/linecalculationinputprice.js +52 -0
  43. package/dist/commonjs/models/linecalculationinputprice.js.map +1 -0
  44. package/dist/commonjs/models/linecalculationinputs.d.ts +34 -0
  45. package/dist/commonjs/models/linecalculationinputs.d.ts.map +1 -0
  46. package/dist/commonjs/models/linecalculationinputs.js +56 -0
  47. package/dist/commonjs/models/linecalculationinputs.js.map +1 -0
  48. package/dist/commonjs/models/linecalculationnotapplied.d.ts +20 -0
  49. package/dist/commonjs/models/linecalculationnotapplied.d.ts.map +1 -0
  50. package/dist/commonjs/models/linecalculationnotapplied.js +51 -0
  51. package/dist/commonjs/models/linecalculationnotapplied.js.map +1 -0
  52. package/dist/commonjs/models/linecalculationperiod.d.ts +14 -0
  53. package/dist/commonjs/models/linecalculationperiod.d.ts.map +1 -0
  54. package/dist/commonjs/models/linecalculationperiod.js +51 -0
  55. package/dist/commonjs/models/linecalculationperiod.js.map +1 -0
  56. package/dist/commonjs/models/linecalculationprecision.d.ts +14 -0
  57. package/dist/commonjs/models/linecalculationprecision.d.ts.map +1 -0
  58. package/dist/commonjs/models/linecalculationprecision.js +51 -0
  59. package/dist/commonjs/models/linecalculationprecision.js.map +1 -0
  60. package/dist/commonjs/models/linecalculationpriceband.d.ts +11 -0
  61. package/dist/commonjs/models/linecalculationpriceband.d.ts.map +1 -0
  62. package/dist/commonjs/models/linecalculationpriceband.js +51 -0
  63. package/dist/commonjs/models/linecalculationpriceband.js.map +1 -0
  64. package/dist/commonjs/models/linecalculationpricefn.d.ts +40 -0
  65. package/dist/commonjs/models/linecalculationpricefn.d.ts.map +1 -0
  66. package/dist/commonjs/models/linecalculationpricefn.js +56 -0
  67. package/dist/commonjs/models/linecalculationpricefn.js.map +1 -0
  68. package/dist/commonjs/models/linecalculationresult.d.ts +24 -0
  69. package/dist/commonjs/models/linecalculationresult.d.ts.map +1 -0
  70. package/dist/commonjs/models/linecalculationresult.js +52 -0
  71. package/dist/commonjs/models/linecalculationresult.js.map +1 -0
  72. package/dist/commonjs/models/linecalculationsource.d.ts +32 -0
  73. package/dist/commonjs/models/linecalculationsource.d.ts.map +1 -0
  74. package/dist/commonjs/models/linecalculationsource.js +53 -0
  75. package/dist/commonjs/models/linecalculationsource.js.map +1 -0
  76. package/dist/commonjs/models/linecalculationstep.d.ts +50 -0
  77. package/dist/commonjs/models/linecalculationstep.d.ts.map +1 -0
  78. package/dist/commonjs/models/linecalculationstep.js +59 -0
  79. package/dist/commonjs/models/linecalculationstep.js.map +1 -0
  80. package/dist/commonjs/models/linecalculationvalue.d.ts +12 -0
  81. package/dist/commonjs/models/linecalculationvalue.d.ts.map +1 -0
  82. package/dist/commonjs/models/linecalculationvalue.js +49 -0
  83. package/dist/commonjs/models/linecalculationvalue.js.map +1 -0
  84. package/dist/commonjs/models/lineitem.d.ts +5 -0
  85. package/dist/commonjs/models/lineitem.d.ts.map +1 -1
  86. package/dist/commonjs/models/lineitem.js +2 -0
  87. package/dist/commonjs/models/lineitem.js.map +1 -1
  88. package/dist/commonjs/models/lineprovenance.d.ts +69 -0
  89. package/dist/commonjs/models/lineprovenance.d.ts.map +1 -0
  90. package/dist/commonjs/models/lineprovenance.js +68 -0
  91. package/dist/commonjs/models/lineprovenance.js.map +1 -0
  92. package/dist/commonjs/models/operations/getinvoice.d.ts +1 -1
  93. package/dist/commonjs/models/operations/getinvoicelineitems.d.ts +1 -1
  94. package/dist/commonjs/models/operations/getrevenue.d.ts +7 -7
  95. package/dist/commonjs/models/operations/getrevenue.js +1 -1
  96. package/dist/commonjs/models/operations/getrevenueaccounts.d.ts +30 -0
  97. package/dist/commonjs/models/operations/getrevenueaccounts.d.ts.map +1 -0
  98. package/dist/commonjs/models/operations/getrevenueaccounts.js +52 -0
  99. package/dist/commonjs/models/operations/getrevenueaccounts.js.map +1 -0
  100. package/dist/commonjs/models/operations/index.d.ts +1 -0
  101. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  102. package/dist/commonjs/models/operations/index.js +1 -0
  103. package/dist/commonjs/models/operations/index.js.map +1 -1
  104. package/dist/commonjs/models/operations/listlineitems.d.ts +1 -1
  105. package/dist/commonjs/models/outstandingblock.d.ts +29 -0
  106. package/dist/commonjs/models/outstandingblock.d.ts.map +1 -0
  107. package/dist/commonjs/models/outstandingblock.js +54 -0
  108. package/dist/commonjs/models/outstandingblock.js.map +1 -0
  109. package/dist/commonjs/models/revenueaccountrow.d.ts +26 -0
  110. package/dist/commonjs/models/revenueaccountrow.d.ts.map +1 -0
  111. package/dist/commonjs/models/revenueaccountrow.js +54 -0
  112. package/dist/commonjs/models/revenueaccountrow.js.map +1 -0
  113. package/dist/commonjs/models/revenueaccountsresponse.d.ts +41 -0
  114. package/dist/commonjs/models/revenueaccountsresponse.d.ts.map +1 -0
  115. package/dist/commonjs/models/revenueaccountsresponse.js +64 -0
  116. package/dist/commonjs/models/revenueaccountsresponse.js.map +1 -0
  117. package/dist/commonjs/models/revenueaccounttotal.d.ts +18 -0
  118. package/dist/commonjs/models/revenueaccounttotal.d.ts.map +1 -0
  119. package/dist/commonjs/models/revenueaccounttotal.js +52 -0
  120. package/dist/commonjs/models/revenueaccounttotal.js.map +1 -0
  121. package/dist/commonjs/models/revenuesummaryresponse.d.ts +4 -0
  122. package/dist/commonjs/models/revenuesummaryresponse.d.ts.map +1 -1
  123. package/dist/commonjs/models/revenuesummaryresponse.js +1 -0
  124. package/dist/commonjs/models/revenuesummaryresponse.js.map +1 -1
  125. package/dist/commonjs/sdk/revenue.d.ts +11 -0
  126. package/dist/commonjs/sdk/revenue.d.ts.map +1 -1
  127. package/dist/commonjs/sdk/revenue.js +14 -0
  128. package/dist/commonjs/sdk/revenue.js.map +1 -1
  129. package/dist/esm/funcs/revenueGetRevenueAccounts.d.ts +23 -0
  130. package/dist/esm/funcs/revenueGetRevenueAccounts.d.ts.map +1 -0
  131. package/dist/esm/funcs/revenueGetRevenueAccounts.js +93 -0
  132. package/dist/esm/funcs/revenueGetRevenueAccounts.js.map +1 -0
  133. package/dist/esm/lib/config.d.ts +2 -2
  134. package/dist/esm/lib/config.js +2 -2
  135. package/dist/esm/models/accountfigure.d.ts +20 -0
  136. package/dist/esm/models/accountfigure.d.ts.map +1 -0
  137. package/dist/esm/models/accountfigure.js +14 -0
  138. package/dist/esm/models/accountfigure.js.map +1 -0
  139. package/dist/esm/models/authorizationdenialreason.d.ts +17 -0
  140. package/dist/esm/models/authorizationdenialreason.d.ts.map +1 -0
  141. package/dist/esm/models/authorizationdenialreason.js +15 -0
  142. package/dist/esm/models/authorizationdenialreason.js.map +1 -0
  143. package/dist/esm/models/errors/error.d.ts +17 -0
  144. package/dist/esm/models/errors/error.d.ts.map +1 -1
  145. package/dist/esm/models/errors/error.js +8 -0
  146. package/dist/esm/models/errors/error.js.map +1 -1
  147. package/dist/esm/models/errors/recordinvoicepayment.d.ts +16 -0
  148. package/dist/esm/models/errors/recordinvoicepayment.d.ts.map +1 -1
  149. package/dist/esm/models/errors/recordinvoicepayment.js +7 -0
  150. package/dist/esm/models/errors/recordinvoicepayment.js.map +1 -1
  151. package/dist/esm/models/index.d.ts +20 -0
  152. package/dist/esm/models/index.d.ts.map +1 -1
  153. package/dist/esm/models/index.js +20 -0
  154. package/dist/esm/models/index.js.map +1 -1
  155. package/dist/esm/models/invoicelineitem.d.ts +5 -0
  156. package/dist/esm/models/invoicelineitem.d.ts.map +1 -1
  157. package/dist/esm/models/invoicelineitem.js +2 -0
  158. package/dist/esm/models/invoicelineitem.js.map +1 -1
  159. package/dist/esm/models/linecalculationcontribution.d.ts +12 -0
  160. package/dist/esm/models/linecalculationcontribution.d.ts.map +1 -0
  161. package/dist/esm/models/linecalculationcontribution.js +15 -0
  162. package/dist/esm/models/linecalculationcontribution.js.map +1 -0
  163. package/dist/esm/models/linecalculationgiven.d.ts +20 -0
  164. package/dist/esm/models/linecalculationgiven.d.ts.map +1 -0
  165. package/dist/esm/models/linecalculationgiven.js +14 -0
  166. package/dist/esm/models/linecalculationgiven.js.map +1 -0
  167. package/dist/esm/models/linecalculationinputprice.d.ts +21 -0
  168. package/dist/esm/models/linecalculationinputprice.d.ts.map +1 -0
  169. package/dist/esm/models/linecalculationinputprice.js +15 -0
  170. package/dist/esm/models/linecalculationinputprice.js.map +1 -0
  171. package/dist/esm/models/linecalculationinputs.d.ts +34 -0
  172. package/dist/esm/models/linecalculationinputs.d.ts.map +1 -0
  173. package/dist/esm/models/linecalculationinputs.js +19 -0
  174. package/dist/esm/models/linecalculationinputs.js.map +1 -0
  175. package/dist/esm/models/linecalculationnotapplied.d.ts +20 -0
  176. package/dist/esm/models/linecalculationnotapplied.d.ts.map +1 -0
  177. package/dist/esm/models/linecalculationnotapplied.js +14 -0
  178. package/dist/esm/models/linecalculationnotapplied.js.map +1 -0
  179. package/dist/esm/models/linecalculationperiod.d.ts +14 -0
  180. package/dist/esm/models/linecalculationperiod.d.ts.map +1 -0
  181. package/dist/esm/models/linecalculationperiod.js +14 -0
  182. package/dist/esm/models/linecalculationperiod.js.map +1 -0
  183. package/dist/esm/models/linecalculationprecision.d.ts +14 -0
  184. package/dist/esm/models/linecalculationprecision.d.ts.map +1 -0
  185. package/dist/esm/models/linecalculationprecision.js +14 -0
  186. package/dist/esm/models/linecalculationprecision.js.map +1 -0
  187. package/dist/esm/models/linecalculationpriceband.d.ts +11 -0
  188. package/dist/esm/models/linecalculationpriceband.d.ts.map +1 -0
  189. package/dist/esm/models/linecalculationpriceband.js +14 -0
  190. package/dist/esm/models/linecalculationpriceband.js.map +1 -0
  191. package/dist/esm/models/linecalculationpricefn.d.ts +40 -0
  192. package/dist/esm/models/linecalculationpricefn.d.ts.map +1 -0
  193. package/dist/esm/models/linecalculationpricefn.js +19 -0
  194. package/dist/esm/models/linecalculationpricefn.js.map +1 -0
  195. package/dist/esm/models/linecalculationresult.d.ts +24 -0
  196. package/dist/esm/models/linecalculationresult.d.ts.map +1 -0
  197. package/dist/esm/models/linecalculationresult.js +15 -0
  198. package/dist/esm/models/linecalculationresult.js.map +1 -0
  199. package/dist/esm/models/linecalculationsource.d.ts +32 -0
  200. package/dist/esm/models/linecalculationsource.d.ts.map +1 -0
  201. package/dist/esm/models/linecalculationsource.js +16 -0
  202. package/dist/esm/models/linecalculationsource.js.map +1 -0
  203. package/dist/esm/models/linecalculationstep.d.ts +50 -0
  204. package/dist/esm/models/linecalculationstep.d.ts.map +1 -0
  205. package/dist/esm/models/linecalculationstep.js +22 -0
  206. package/dist/esm/models/linecalculationstep.js.map +1 -0
  207. package/dist/esm/models/linecalculationvalue.d.ts +12 -0
  208. package/dist/esm/models/linecalculationvalue.d.ts.map +1 -0
  209. package/dist/esm/models/linecalculationvalue.js +12 -0
  210. package/dist/esm/models/linecalculationvalue.js.map +1 -0
  211. package/dist/esm/models/lineitem.d.ts +5 -0
  212. package/dist/esm/models/lineitem.d.ts.map +1 -1
  213. package/dist/esm/models/lineitem.js +2 -0
  214. package/dist/esm/models/lineitem.js.map +1 -1
  215. package/dist/esm/models/lineprovenance.d.ts +69 -0
  216. package/dist/esm/models/lineprovenance.d.ts.map +1 -0
  217. package/dist/esm/models/lineprovenance.js +31 -0
  218. package/dist/esm/models/lineprovenance.js.map +1 -0
  219. package/dist/esm/models/operations/getinvoice.d.ts +1 -1
  220. package/dist/esm/models/operations/getinvoicelineitems.d.ts +1 -1
  221. package/dist/esm/models/operations/getrevenue.d.ts +7 -7
  222. package/dist/esm/models/operations/getrevenue.js +1 -1
  223. package/dist/esm/models/operations/getrevenueaccounts.d.ts +30 -0
  224. package/dist/esm/models/operations/getrevenueaccounts.d.ts.map +1 -0
  225. package/dist/esm/models/operations/getrevenueaccounts.js +15 -0
  226. package/dist/esm/models/operations/getrevenueaccounts.js.map +1 -0
  227. package/dist/esm/models/operations/index.d.ts +1 -0
  228. package/dist/esm/models/operations/index.d.ts.map +1 -1
  229. package/dist/esm/models/operations/index.js +1 -0
  230. package/dist/esm/models/operations/index.js.map +1 -1
  231. package/dist/esm/models/operations/listlineitems.d.ts +1 -1
  232. package/dist/esm/models/outstandingblock.d.ts +29 -0
  233. package/dist/esm/models/outstandingblock.d.ts.map +1 -0
  234. package/dist/esm/models/outstandingblock.js +17 -0
  235. package/dist/esm/models/outstandingblock.js.map +1 -0
  236. package/dist/esm/models/revenueaccountrow.d.ts +26 -0
  237. package/dist/esm/models/revenueaccountrow.d.ts.map +1 -0
  238. package/dist/esm/models/revenueaccountrow.js +17 -0
  239. package/dist/esm/models/revenueaccountrow.js.map +1 -0
  240. package/dist/esm/models/revenueaccountsresponse.d.ts +41 -0
  241. package/dist/esm/models/revenueaccountsresponse.d.ts.map +1 -0
  242. package/dist/esm/models/revenueaccountsresponse.js +27 -0
  243. package/dist/esm/models/revenueaccountsresponse.js.map +1 -0
  244. package/dist/esm/models/revenueaccounttotal.d.ts +18 -0
  245. package/dist/esm/models/revenueaccounttotal.d.ts.map +1 -0
  246. package/dist/esm/models/revenueaccounttotal.js +15 -0
  247. package/dist/esm/models/revenueaccounttotal.js.map +1 -0
  248. package/dist/esm/models/revenuesummaryresponse.d.ts +4 -0
  249. package/dist/esm/models/revenuesummaryresponse.d.ts.map +1 -1
  250. package/dist/esm/models/revenuesummaryresponse.js +1 -0
  251. package/dist/esm/models/revenuesummaryresponse.js.map +1 -1
  252. package/dist/esm/sdk/revenue.d.ts +11 -0
  253. package/dist/esm/sdk/revenue.d.ts.map +1 -1
  254. package/dist/esm/sdk/revenue.js +14 -0
  255. package/dist/esm/sdk/revenue.js.map +1 -1
  256. package/jsr.json +1 -1
  257. package/package.json +1 -1
  258. package/src/funcs/revenueGetRevenueAccounts.ts +186 -0
  259. package/src/lib/config.ts +2 -2
  260. package/src/models/accountfigure.ts +42 -0
  261. package/src/models/authorizationdenialreason.ts +26 -0
  262. package/src/models/errors/error.ts +23 -0
  263. package/src/models/errors/recordinvoicepayment.ts +22 -0
  264. package/src/models/index.ts +20 -0
  265. package/src/models/invoicelineitem.ts +9 -0
  266. package/src/models/linecalculationcontribution.ts +35 -0
  267. package/src/models/linecalculationgiven.ts +42 -0
  268. package/src/models/linecalculationinputprice.ts +46 -0
  269. package/src/models/linecalculationinputs.ts +65 -0
  270. package/src/models/linecalculationnotapplied.ts +42 -0
  271. package/src/models/linecalculationperiod.ts +36 -0
  272. package/src/models/linecalculationprecision.ts +36 -0
  273. package/src/models/linecalculationpriceband.ts +33 -0
  274. package/src/models/linecalculationpricefn.ts +74 -0
  275. package/src/models/linecalculationresult.ts +47 -0
  276. package/src/models/linecalculationsource.ts +52 -0
  277. package/src/models/linecalculationstep.ts +80 -0
  278. package/src/models/linecalculationvalue.ts +34 -0
  279. package/src/models/lineitem.ts +9 -0
  280. package/src/models/lineprovenance.ts +122 -0
  281. package/src/models/operations/getinvoice.ts +1 -1
  282. package/src/models/operations/getinvoicelineitems.ts +1 -1
  283. package/src/models/operations/getrevenue.ts +7 -7
  284. package/src/models/operations/getrevenueaccounts.ts +52 -0
  285. package/src/models/operations/index.ts +1 -0
  286. package/src/models/operations/listlineitems.ts +1 -1
  287. package/src/models/outstandingblock.ts +53 -0
  288. package/src/models/revenueaccountrow.ts +53 -0
  289. package/src/models/revenueaccountsresponse.ts +80 -0
  290. package/src/models/revenueaccounttotal.ts +43 -0
  291. package/src/models/revenuesummaryresponse.ts +5 -0
  292. package/src/sdk/revenue.ts +22 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paygentic/sdk",
3
- "version": "0.9.17",
3
+ "version": "0.10.0",
4
4
  "author": "Speakeasy",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,186 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PaygenticCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import * as errors from "../models/errors/index.js";
21
+ import { PaygenticError } from "../models/errors/paygenticerror.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as models from "../models/index.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List customer accounts
31
+ *
32
+ * @remarks
33
+ * Returns each customer's account as at today, one row per customer and currency, with a total per currency. Every figure covers all dates: there is no date window.
34
+ *
35
+ * `outstanding` is what customers owe: every invoice with status `ISSUED` or `PAYMENT_FAILED`, at the amount due printed on the invoice (subtotal and tax, each rounded to the currency's minor unit), so it is gross of tax. Revenue (`GET /v0/revenue`) is net of tax. `outstanding` splits into `awaitingPayment` (status `ISSUED`) and `paymentFailed` (status `PAYMENT_FAILED`, collection has ended); the two always add up to it, in count and amount. A credit invoice (a negative amount due) nets against what is owed and is counted in no `count`; nor is an invoice whose amount due rounds to zero. A customer with nothing counted and nothing owed has no row.
36
+ *
37
+ * Amounts are grouped by currency and never combined or converted. `totals` covers every row in the filter, not only the returned page, so the rows on one page add up to `totals` only when the page holds every row. Pages fetched in separate requests are separate reads.
38
+ */
39
+ export function revenueGetRevenueAccounts(
40
+ client: PaygenticCore,
41
+ request: operations.GetRevenueAccountsRequest,
42
+ options?: RequestOptions,
43
+ ): APIPromise<
44
+ Result<
45
+ models.RevenueAccountsResponse,
46
+ | errors.BadRequest
47
+ | errors.ErrorT
48
+ | PaygenticError
49
+ | ResponseValidationError
50
+ | ConnectionError
51
+ | RequestAbortedError
52
+ | RequestTimeoutError
53
+ | InvalidRequestError
54
+ | UnexpectedClientError
55
+ | SDKValidationError
56
+ >
57
+ > {
58
+ return new APIPromise($do(
59
+ client,
60
+ request,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ async function $do(
66
+ client: PaygenticCore,
67
+ request: operations.GetRevenueAccountsRequest,
68
+ options?: RequestOptions,
69
+ ): Promise<
70
+ [
71
+ Result<
72
+ models.RevenueAccountsResponse,
73
+ | errors.BadRequest
74
+ | errors.ErrorT
75
+ | PaygenticError
76
+ | ResponseValidationError
77
+ | ConnectionError
78
+ | RequestAbortedError
79
+ | RequestTimeoutError
80
+ | InvalidRequestError
81
+ | UnexpectedClientError
82
+ | SDKValidationError
83
+ >,
84
+ APICall,
85
+ ]
86
+ > {
87
+ const parsed = safeParse(
88
+ request,
89
+ (value) => operations.GetRevenueAccountsRequest$outboundSchema.parse(value),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed.ok) {
93
+ return [parsed, { status: "invalid" }];
94
+ }
95
+ const payload = parsed.value;
96
+ const body = null;
97
+
98
+ const path = pathToFunc("/v0/revenue/accounts")();
99
+
100
+ const query = encodeFormQuery({
101
+ "customerIds": payload.customerIds,
102
+ "limit": payload.limit,
103
+ "merchantId": payload.merchantId,
104
+ "offset": payload.offset,
105
+ });
106
+
107
+ const headers = new Headers(compactMap({
108
+ Accept: "application/json",
109
+ }));
110
+
111
+ const secConfig = await extractSecurity(client._options.bearerAuth);
112
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
113
+ const requestSecurity = resolveGlobalSecurity(securityInput);
114
+
115
+ const context = {
116
+ options: client._options,
117
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
118
+ operationID: "getRevenueAccounts",
119
+ oAuth2Scopes: null,
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.bearerAuth,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "GET",
133
+ baseURL: options?.serverURL,
134
+ path: path,
135
+ headers: headers,
136
+ query: query,
137
+ body: body,
138
+ userAgent: client._options.userAgent,
139
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
+ }, options);
141
+ if (!requestRes.ok) {
142
+ return [requestRes, { status: "invalid" }];
143
+ }
144
+ const req = requestRes.value;
145
+
146
+ const doResult = await client._do(req, {
147
+ context,
148
+ errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
149
+ retryConfig: context.retryConfig,
150
+ retryCodes: context.retryCodes,
151
+ });
152
+ if (!doResult.ok) {
153
+ return [doResult, { status: "request-error", request: req }];
154
+ }
155
+ const response = doResult.value;
156
+
157
+ const responseFields = {
158
+ HttpMeta: { Response: response, Request: req },
159
+ };
160
+
161
+ const [result] = await M.match<
162
+ models.RevenueAccountsResponse,
163
+ | errors.BadRequest
164
+ | errors.ErrorT
165
+ | PaygenticError
166
+ | ResponseValidationError
167
+ | ConnectionError
168
+ | RequestAbortedError
169
+ | RequestTimeoutError
170
+ | InvalidRequestError
171
+ | UnexpectedClientError
172
+ | SDKValidationError
173
+ >(
174
+ M.json(200, models.RevenueAccountsResponse$inboundSchema),
175
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
176
+ M.jsonErr([401, 403, 404], errors.ErrorT$inboundSchema),
177
+ M.jsonErr(500, errors.ErrorT$inboundSchema),
178
+ M.fail("4XX"),
179
+ M.fail("5XX"),
180
+ )(response, req, { extraFields: responseFields });
181
+ if (!result.ok) {
182
+ return [result, { status: "complete", request: req, response }];
183
+ }
184
+
185
+ return [result, { status: "complete", request: req, response }];
186
+ }
package/src/lib/config.ts CHANGED
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "0.1.0",
68
- sdkVersion: "0.9.17",
68
+ sdkVersion: "0.10.0",
69
69
  genVersion: "2.879.13",
70
- userAgent: "speakeasy-sdk/typescript 0.9.17 2.879.13 0.1.0 @paygentic/sdk",
70
+ userAgent: "speakeasy-sdk/typescript 0.10.0 2.879.13 0.1.0 @paygentic/sdk",
71
71
  } as const;
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * A number of invoices and their total amount due, gross of tax.
12
+ */
13
+ export type AccountFigure = {
14
+ /**
15
+ * Number of invoices with an amount due above zero. A credit invoice, or one whose amount due rounds to zero, is not counted.
16
+ */
17
+ count: number;
18
+ /**
19
+ * Total amount due in major units of the currency, in its decimal places
20
+ */
21
+ amount: string;
22
+ };
23
+
24
+ /** @internal */
25
+ export const AccountFigure$inboundSchema: z.ZodType<
26
+ AccountFigure,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ count: z.number().int(),
31
+ amount: z.string(),
32
+ });
33
+
34
+ export function accountFigureFromJSON(
35
+ jsonString: string,
36
+ ): SafeParseResult<AccountFigure, SDKValidationError> {
37
+ return safeParse(
38
+ jsonString,
39
+ (x) => AccountFigure$inboundSchema.parse(JSON.parse(x)),
40
+ `Failed to parse 'AccountFigure' from JSON`,
41
+ );
42
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+
8
+ /**
9
+ * Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
10
+ */
11
+ export const AuthorizationDenialReason = {
12
+ NoPermission: "no_permission",
13
+ InsufficientScope: "insufficient_scope",
14
+ NotMember: "not_member",
15
+ } as const;
16
+ /**
17
+ * Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
18
+ */
19
+ export type AuthorizationDenialReason = ClosedEnum<
20
+ typeof AuthorizationDenialReason
21
+ >;
22
+
23
+ /** @internal */
24
+ export const AuthorizationDenialReason$inboundSchema: z.ZodNativeEnum<
25
+ typeof AuthorizationDenialReason
26
+ > = z.nativeEnum(AuthorizationDenialReason);
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import * as models from "../index.js";
6
7
  import { PaygenticError } from "./paygenticerror.js";
7
8
 
8
9
  export type ErrorTData = {
@@ -22,6 +23,14 @@ export type ErrorTData = {
22
23
  * Additional error details
23
24
  */
24
25
  details?: { [k: string]: any } | undefined;
26
+ /**
27
+ * Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
28
+ */
29
+ reason?: models.AuthorizationDenialReason | undefined;
30
+ /**
31
+ * Present on a 403 from the authorization check. The permissions the caller needs for this request.
32
+ */
33
+ requiredPermissions?: Array<string> | undefined;
25
34
  };
26
35
 
27
36
  export class ErrorT extends PaygenticError {
@@ -37,6 +46,14 @@ export class ErrorT extends PaygenticError {
37
46
  * Additional error details
38
47
  */
39
48
  details?: { [k: string]: any } | undefined;
49
+ /**
50
+ * Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
51
+ */
52
+ reason?: models.AuthorizationDenialReason | undefined;
53
+ /**
54
+ * Present on a 403 from the authorization check. The permissions the caller needs for this request.
55
+ */
56
+ requiredPermissions?: Array<string> | undefined;
40
57
 
41
58
  /** The original data that was passed to this error instance. */
42
59
  data$: ErrorTData;
@@ -51,6 +68,10 @@ export class ErrorT extends PaygenticError {
51
68
  if (err.error != null) this.error = err.error;
52
69
  if (err.code != null) this.code = err.code;
53
70
  if (err.details != null) this.details = err.details;
71
+ if (err.reason != null) this.reason = err.reason;
72
+ if (err.requiredPermissions != null) {
73
+ this.requiredPermissions = err.requiredPermissions;
74
+ }
54
75
 
55
76
  this.name = "ErrorT";
56
77
  }
@@ -63,6 +84,8 @@ export const ErrorT$inboundSchema: z.ZodType<ErrorT, z.ZodTypeDef, unknown> = z
63
84
  message: z.string(),
64
85
  code: z.string().optional(),
65
86
  details: z.record(z.any()).optional(),
87
+ reason: models.AuthorizationDenialReason$inboundSchema.optional(),
88
+ requiredPermissions: z.array(z.string()).optional(),
66
89
  request$: z.instanceof(Request),
67
90
  response$: z.instanceof(Response),
68
91
  body$: z.string(),
@@ -26,6 +26,14 @@ export type UnprocessableEntityErrorData = {
26
26
  * Additional error details
27
27
  */
28
28
  details?: { [k: string]: any } | undefined;
29
+ /**
30
+ * Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
31
+ */
32
+ reason?: models.AuthorizationDenialReason | undefined;
33
+ /**
34
+ * Present on a 403 from the authorization check. The permissions the caller needs for this request.
35
+ */
36
+ requiredPermissions?: Array<string> | undefined;
29
37
  };
30
38
 
31
39
  /**
@@ -44,6 +52,14 @@ export class UnprocessableEntityError extends PaygenticError {
44
52
  * Additional error details
45
53
  */
46
54
  details?: { [k: string]: any } | undefined;
55
+ /**
56
+ * Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
57
+ */
58
+ reason?: models.AuthorizationDenialReason | undefined;
59
+ /**
60
+ * Present on a 403 from the authorization check. The permissions the caller needs for this request.
61
+ */
62
+ requiredPermissions?: Array<string> | undefined;
47
63
 
48
64
  /** The original data that was passed to this error instance. */
49
65
  data$: UnprocessableEntityErrorData;
@@ -58,6 +74,10 @@ export class UnprocessableEntityError extends PaygenticError {
58
74
  this.error = err.error;
59
75
  this.code = err.code;
60
76
  if (err.details != null) this.details = err.details;
77
+ if (err.reason != null) this.reason = err.reason;
78
+ if (err.requiredPermissions != null) {
79
+ this.requiredPermissions = err.requiredPermissions;
80
+ }
61
81
 
62
82
  this.name = "UnprocessableEntityError";
63
83
  }
@@ -73,6 +93,8 @@ export const UnprocessableEntityError$inboundSchema: z.ZodType<
73
93
  message: z.string(),
74
94
  code: models.InvoicePaymentLinkErrorCode$inboundSchema,
75
95
  details: z.record(z.any()).optional(),
96
+ reason: models.AuthorizationDenialReason$inboundSchema.optional(),
97
+ requiredPermissions: z.array(z.string()).optional(),
76
98
  request$: z.instanceof(Request),
77
99
  response$: z.instanceof(Response),
78
100
  body$: z.string(),
@@ -2,9 +2,11 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ export * from "./accountfigure.js";
5
6
  export * from "./address.js";
6
7
  export * from "./approval.js";
7
8
  export * from "./approvallist.js";
9
+ export * from "./authorizationdenialreason.js";
8
10
  export * from "./billablemetric.js";
9
11
  export * from "./billingschedule.js";
10
12
  export * from "./booleanentitlementdetail.js";
@@ -60,9 +62,23 @@ export * from "./invoicerefundlist.js";
60
62
  export * from "./invoicesummary.js";
61
63
  export * from "./issueentitlementrequest.js";
62
64
  export * from "./item.js";
65
+ export * from "./linecalculationcontribution.js";
66
+ export * from "./linecalculationgiven.js";
67
+ export * from "./linecalculationinputprice.js";
68
+ export * from "./linecalculationinputs.js";
69
+ export * from "./linecalculationnotapplied.js";
70
+ export * from "./linecalculationperiod.js";
71
+ export * from "./linecalculationprecision.js";
72
+ export * from "./linecalculationpriceband.js";
73
+ export * from "./linecalculationpricefn.js";
74
+ export * from "./linecalculationresult.js";
75
+ export * from "./linecalculationsource.js";
76
+ export * from "./linecalculationstep.js";
77
+ export * from "./linecalculationvalue.js";
63
78
  export * from "./lineitem.js";
64
79
  export * from "./lineitemsresponse.js";
65
80
  export * from "./lineitemssummary.js";
81
+ export * from "./lineprovenance.js";
66
82
  export * from "./mappingcapabilities.js";
67
83
  export * from "./merchantintegration.js";
68
84
  export * from "./merchantintegrationprovider.js";
@@ -84,6 +100,7 @@ export * from "./orderbillingschedule.js";
84
100
  export * from "./orderlineitem.js";
85
101
  export * from "./orderlist.js";
86
102
  export * from "./outofbandpaymentresult.js";
103
+ export * from "./outstandingblock.js";
87
104
  export * from "./payment.js";
88
105
  export * from "./paymentmethod.js";
89
106
  export * from "./paymentsession.js";
@@ -117,6 +134,9 @@ export * from "./replacescheduleintervalsrequest.js";
117
134
  export * from "./resolveditem.js";
118
135
  export * from "./retrypaymenterror.js";
119
136
  export * from "./retrypaymentresponse.js";
137
+ export * from "./revenueaccountrow.js";
138
+ export * from "./revenueaccountsresponse.js";
139
+ export * from "./revenueaccounttotal.js";
120
140
  export * from "./revenuesummaryresponse.js";
121
141
  export * from "./revenuetrendbucket.js";
122
142
  export * from "./rulecondition.js";
@@ -7,6 +7,10 @@ import { safeParse } from "../lib/schemas.js";
7
7
  import { ClosedEnum } from "../types/enums.js";
8
8
  import { Result as SafeParseResult } from "../types/fp.js";
9
9
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+ import {
11
+ LineProvenance,
12
+ LineProvenance$inboundSchema,
13
+ } from "./lineprovenance.js";
10
14
 
11
15
  /**
12
16
  * Type of event: 'usage' for billable metric events, 'fee' for fee events, 'discount' for grant discount line items (subtotal/total are negative, representing a credit)
@@ -134,6 +138,10 @@ export type InvoiceLineItem = {
134
138
  * Unit price in decimal dollars
135
139
  */
136
140
  unitPrice: string;
141
+ /**
142
+ * How the line's amount before tax was calculated: a trace of one evaluation, saved when the invoice was calculated and fixed once it is issued. Returned only with `expand=lineProvenance`. Every field but `status` is present when `status` is `recorded`. Every number is a plain decimal string.
143
+ */
144
+ provenance?: LineProvenance | undefined;
137
145
  };
138
146
 
139
147
  /** @internal */
@@ -179,6 +187,7 @@ export const InvoiceLineItem$inboundSchema: z.ZodType<
179
187
  totalPrice: z.string(),
180
188
  totalTax: z.string(),
181
189
  unitPrice: z.string(),
190
+ provenance: LineProvenance$inboundSchema.optional(),
182
191
  });
183
192
 
184
193
  export function invoiceLineItemFromJSON(
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+
10
+ export type LineCalculationContribution = {
11
+ lineItemId: string;
12
+ value: string;
13
+ share: string | null;
14
+ };
15
+
16
+ /** @internal */
17
+ export const LineCalculationContribution$inboundSchema: z.ZodType<
18
+ LineCalculationContribution,
19
+ z.ZodTypeDef,
20
+ unknown
21
+ > = z.object({
22
+ lineItemId: z.string(),
23
+ value: z.string(),
24
+ share: z.nullable(z.string()),
25
+ });
26
+
27
+ export function lineCalculationContributionFromJSON(
28
+ jsonString: string,
29
+ ): SafeParseResult<LineCalculationContribution, SDKValidationError> {
30
+ return safeParse(
31
+ jsonString,
32
+ (x) => LineCalculationContribution$inboundSchema.parse(JSON.parse(x)),
33
+ `Failed to parse 'LineCalculationContribution' from JSON`,
34
+ );
35
+ }
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * A value the evaluation started from, and its source.
12
+ */
13
+ export type LineCalculationGiven = {
14
+ /**
15
+ * The value.
16
+ */
17
+ value: string;
18
+ /**
19
+ * The key of the source in `sources` that stated it.
20
+ */
21
+ source: string;
22
+ };
23
+
24
+ /** @internal */
25
+ export const LineCalculationGiven$inboundSchema: z.ZodType<
26
+ LineCalculationGiven,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ value: z.string(),
31
+ source: z.string(),
32
+ });
33
+
34
+ export function lineCalculationGivenFromJSON(
35
+ jsonString: string,
36
+ ): SafeParseResult<LineCalculationGiven, SDKValidationError> {
37
+ return safeParse(
38
+ jsonString,
39
+ (x) => LineCalculationGiven$inboundSchema.parse(JSON.parse(x)),
40
+ `Failed to parse 'LineCalculationGiven' from JSON`,
41
+ );
42
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+ import {
10
+ LineCalculationPriceFn,
11
+ LineCalculationPriceFn$inboundSchema,
12
+ } from "./linecalculationpricefn.js";
13
+
14
+ /**
15
+ * `priced` only: the price as a function, and its source.
16
+ */
17
+ export type LineCalculationInputPrice = {
18
+ /**
19
+ * A price as a function from quantity to money. A new model may carry fields not listed here.
20
+ */
21
+ fn: LineCalculationPriceFn;
22
+ /**
23
+ * The key of the source in `sources` that stated the price.
24
+ */
25
+ source: string;
26
+ };
27
+
28
+ /** @internal */
29
+ export const LineCalculationInputPrice$inboundSchema: z.ZodType<
30
+ LineCalculationInputPrice,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ fn: LineCalculationPriceFn$inboundSchema,
35
+ source: z.string(),
36
+ });
37
+
38
+ export function lineCalculationInputPriceFromJSON(
39
+ jsonString: string,
40
+ ): SafeParseResult<LineCalculationInputPrice, SDKValidationError> {
41
+ return safeParse(
42
+ jsonString,
43
+ (x) => LineCalculationInputPrice$inboundSchema.parse(JSON.parse(x)),
44
+ `Failed to parse 'LineCalculationInputPrice' from JSON`,
45
+ );
46
+ }
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+ import {
10
+ LineCalculationGiven,
11
+ LineCalculationGiven$inboundSchema,
12
+ } from "./linecalculationgiven.js";
13
+ import {
14
+ LineCalculationInputPrice,
15
+ LineCalculationInputPrice$inboundSchema,
16
+ } from "./linecalculationinputprice.js";
17
+
18
+ /**
19
+ * The values the evaluation started from.
20
+ */
21
+ export type LineCalculationInputs = {
22
+ /**
23
+ * `priced`: a charge from a price, with `quantity`, `selector` and `price`. `fromLine`: a line whose base is another line's amount, with `amount`. `given`: an amount nobody priced on this run, with `amount`. An open set, so it is a string rather than an enum: known values are `priced`, `fromLine`, `given`, and new values may be added.
24
+ */
25
+ kind: string;
26
+ /**
27
+ * A value the evaluation started from, and its source.
28
+ */
29
+ quantity?: LineCalculationGiven | undefined;
30
+ /**
31
+ * A value the evaluation started from, and its source.
32
+ */
33
+ selector?: LineCalculationGiven | undefined;
34
+ /**
35
+ * `priced` only: the price as a function, and its source.
36
+ */
37
+ price?: LineCalculationInputPrice | undefined;
38
+ /**
39
+ * A value the evaluation started from, and its source.
40
+ */
41
+ amount?: LineCalculationGiven | undefined;
42
+ };
43
+
44
+ /** @internal */
45
+ export const LineCalculationInputs$inboundSchema: z.ZodType<
46
+ LineCalculationInputs,
47
+ z.ZodTypeDef,
48
+ unknown
49
+ > = z.object({
50
+ kind: z.string(),
51
+ quantity: LineCalculationGiven$inboundSchema.optional(),
52
+ selector: LineCalculationGiven$inboundSchema.optional(),
53
+ price: LineCalculationInputPrice$inboundSchema.optional(),
54
+ amount: LineCalculationGiven$inboundSchema.optional(),
55
+ });
56
+
57
+ export function lineCalculationInputsFromJSON(
58
+ jsonString: string,
59
+ ): SafeParseResult<LineCalculationInputs, SDKValidationError> {
60
+ return safeParse(
61
+ jsonString,
62
+ (x) => LineCalculationInputs$inboundSchema.parse(JSON.parse(x)),
63
+ `Failed to parse 'LineCalculationInputs' from JSON`,
64
+ );
65
+ }