orb-billing 1.0.1 → 1.19.5

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 (1258) hide show
  1. package/README.md +61 -41
  2. package/dist/internal/utils/requestbody.d.ts +1 -1
  3. package/dist/internal/utils/requestbody.js +1 -1
  4. package/dist/internal/utils/retries.d.ts +2 -2
  5. package/dist/internal/utils/security.d.ts +5 -2
  6. package/dist/internal/utils/security.js +28 -28
  7. package/dist/internal/utils/utils.js +1 -1
  8. package/dist/sdk/availability.d.ts +3 -4
  9. package/dist/sdk/availability.js +80 -10
  10. package/dist/sdk/coupon.d.ts +16 -7
  11. package/dist/sdk/coupon.js +396 -35
  12. package/dist/sdk/credit.d.ts +242 -36
  13. package/dist/sdk/credit.js +704 -77
  14. package/dist/sdk/creditnote.d.ts +8 -5
  15. package/dist/sdk/creditnote.js +160 -16
  16. package/dist/sdk/customer.d.ts +358 -93
  17. package/dist/sdk/customer.js +1351 -189
  18. package/dist/sdk/event.d.ts +198 -103
  19. package/dist/sdk/event.js +906 -157
  20. package/dist/sdk/invoice.d.ts +39 -10
  21. package/dist/sdk/invoice.js +727 -47
  22. package/dist/sdk/item.d.ts +27 -0
  23. package/dist/sdk/item.js +328 -0
  24. package/dist/sdk/metric.d.ts +39 -0
  25. package/dist/sdk/metric.js +475 -0
  26. package/dist/sdk/models/errors/index.d.ts +1 -0
  27. package/dist/sdk/models/errors/index.js +20 -0
  28. package/dist/sdk/models/errors/sdkerror.d.ts +7 -0
  29. package/dist/sdk/models/errors/sdkerror.js +40 -0
  30. package/dist/sdk/models/operations/addeditpriceintervals.d.ts +53 -0
  31. package/dist/sdk/models/operations/addeditpriceintervals.js +123 -0
  32. package/dist/sdk/models/operations/amendevent.d.ts +35 -5
  33. package/dist/sdk/models/operations/amendevent.js +28 -4
  34. package/dist/sdk/models/operations/amendusage.d.ts +36 -15
  35. package/dist/sdk/models/operations/amendusage.js +31 -22
  36. package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +36 -15
  37. package/dist/sdk/models/operations/amendusageexternalcustomerid.js +31 -22
  38. package/dist/sdk/models/operations/archivecoupon.d.ts +37 -0
  39. package/dist/sdk/models/operations/archivecoupon.js +28 -0
  40. package/dist/sdk/models/operations/cancelsubscription.d.ts +38 -1
  41. package/dist/sdk/models/operations/cancelsubscription.js +30 -2
  42. package/dist/sdk/models/operations/closebackfill.d.ts +37 -0
  43. package/dist/sdk/models/operations/closebackfill.js +28 -0
  44. package/dist/sdk/models/operations/createbackfill.d.ts +37 -0
  45. package/dist/sdk/models/operations/createbackfill.js +28 -0
  46. package/dist/sdk/models/operations/createcoupon.d.ts +38 -1
  47. package/dist/sdk/models/operations/createcoupon.js +28 -0
  48. package/dist/sdk/models/operations/createcustomer.d.ts +37 -0
  49. package/dist/sdk/models/operations/createcustomer.js +28 -0
  50. package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +38 -1
  51. package/dist/sdk/models/operations/createcustomerbalancetransaction.js +30 -2
  52. package/dist/sdk/models/operations/createinvoice.d.ts +49 -0
  53. package/dist/sdk/models/operations/createinvoice.js +107 -0
  54. package/dist/sdk/models/operations/createinvoicelineitem.d.ts +37 -0
  55. package/dist/sdk/models/operations/createinvoicelineitem.js +28 -0
  56. package/dist/sdk/models/operations/createledgerentry.d.ts +40 -3
  57. package/dist/sdk/models/operations/createledgerentry.js +31 -3
  58. package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +53 -0
  59. package/dist/sdk/models/operations/createledgerentryexternalid.js +123 -0
  60. package/dist/sdk/models/operations/createmetric.d.ts +49 -0
  61. package/dist/sdk/models/operations/createmetric.js +107 -0
  62. package/dist/sdk/models/operations/createplan.d.ts +49 -0
  63. package/dist/sdk/models/operations/createplan.js +107 -0
  64. package/dist/sdk/models/operations/createprice.d.ts +49 -0
  65. package/dist/sdk/models/operations/{addledgerentryexternalid.js → createprice.js} +37 -25
  66. package/dist/sdk/models/operations/createsubscription.d.ts +38 -1
  67. package/dist/sdk/models/operations/createsubscription.js +28 -0
  68. package/dist/sdk/models/operations/deletecustomer.d.ts +41 -11
  69. package/dist/sdk/models/operations/deletecustomer.js +57 -16
  70. package/dist/sdk/models/operations/deprecateevent.d.ts +35 -5
  71. package/dist/sdk/models/operations/deprecateevent.js +28 -4
  72. package/dist/sdk/models/operations/fetchbackfill.d.ts +52 -0
  73. package/dist/sdk/models/operations/fetchbackfill.js +119 -0
  74. package/dist/sdk/models/operations/fetchcoupon.d.ts +37 -0
  75. package/dist/sdk/models/operations/fetchcoupon.js +28 -0
  76. package/dist/sdk/models/operations/fetchcreditnote.d.ts +37 -3
  77. package/dist/sdk/models/operations/fetchcreditnote.js +28 -0
  78. package/dist/sdk/models/operations/fetchcustomer.d.ts +38 -4
  79. package/dist/sdk/models/operations/fetchcustomer.js +28 -0
  80. package/dist/sdk/models/operations/fetchcustomercosts.d.ts +44 -12
  81. package/dist/sdk/models/operations/fetchcustomercosts.js +37 -1
  82. package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +45 -10
  83. package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +37 -1
  84. package/dist/sdk/models/operations/fetchcustomercredits.d.ts +37 -9
  85. package/dist/sdk/models/operations/fetchcustomercredits.js +31 -3
  86. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +39 -8
  87. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +31 -3
  88. package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +53 -13
  89. package/dist/sdk/models/operations/fetchcustomercreditsledger.js +66 -3
  90. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +53 -13
  91. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +66 -3
  92. package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +37 -0
  93. package/dist/sdk/models/operations/fetchcustomerexternalid.js +28 -0
  94. package/dist/sdk/models/operations/fetchinvoice.d.ts +37 -0
  95. package/dist/sdk/models/operations/fetchinvoice.js +28 -0
  96. package/dist/sdk/models/operations/fetchitem.d.ts +52 -0
  97. package/dist/sdk/models/operations/fetchitem.js +119 -0
  98. package/dist/sdk/models/operations/fetchmetric.d.ts +52 -0
  99. package/dist/sdk/models/operations/fetchmetric.js +119 -0
  100. package/dist/sdk/models/operations/fetchplan.d.ts +37 -0
  101. package/dist/sdk/models/operations/fetchplan.js +28 -0
  102. package/dist/sdk/models/operations/fetchplanexternalid.d.ts +37 -0
  103. package/dist/sdk/models/operations/fetchplanexternalid.js +28 -0
  104. package/dist/sdk/models/operations/fetchprice.d.ts +52 -0
  105. package/dist/sdk/models/operations/fetchprice.js +119 -0
  106. package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +52 -0
  107. package/dist/sdk/models/operations/fetchpriceexternalid.js +119 -0
  108. package/dist/sdk/models/operations/fetchsubscription.d.ts +37 -0
  109. package/dist/sdk/models/operations/fetchsubscription.js +28 -0
  110. package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +45 -10
  111. package/dist/sdk/models/operations/fetchsubscriptioncosts.js +37 -1
  112. package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +43 -8
  113. package/dist/sdk/models/operations/fetchsubscriptionschedule.js +47 -3
  114. package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +60 -16
  115. package/dist/sdk/models/operations/fetchsubscriptionusage.js +69 -2
  116. package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +38 -1
  117. package/dist/sdk/models/operations/fetchupcominginvoice.js +28 -0
  118. package/dist/sdk/models/operations/index.d.ts +20 -2
  119. package/dist/sdk/models/operations/index.js +20 -2
  120. package/dist/sdk/models/operations/ingest.d.ts +36 -12
  121. package/dist/sdk/models/operations/ingest.js +31 -22
  122. package/dist/sdk/models/operations/issueinvoice.d.ts +35 -2
  123. package/dist/sdk/models/operations/issueinvoice.js +28 -4
  124. package/dist/sdk/models/operations/listbackfills.d.ts +37 -6
  125. package/dist/sdk/models/operations/listbackfills.js +29 -1
  126. package/dist/sdk/models/operations/listbalancetransactions.d.ts +45 -10
  127. package/dist/sdk/models/operations/listbalancetransactions.js +49 -5
  128. package/dist/sdk/models/operations/listcoupons.d.ts +35 -10
  129. package/dist/sdk/models/operations/listcoupons.js +29 -1
  130. package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +39 -0
  131. package/dist/sdk/models/operations/listcouponsubscriptions.js +36 -0
  132. package/dist/sdk/models/operations/listcreditnotes.d.ts +53 -0
  133. package/dist/sdk/models/operations/listcreditnotes.js +123 -0
  134. package/dist/sdk/models/operations/listcustomers.d.ts +41 -6
  135. package/dist/sdk/models/operations/listcustomers.js +45 -1
  136. package/dist/sdk/models/operations/listinvoices.d.ts +66 -14
  137. package/dist/sdk/models/operations/listinvoices.js +109 -3
  138. package/dist/sdk/models/operations/listitems.d.ts +53 -0
  139. package/dist/sdk/models/operations/{listcreditnote.js → listitems.js} +46 -30
  140. package/dist/sdk/models/operations/listmetrics.d.ts +57 -0
  141. package/dist/sdk/models/operations/listmetrics.js +139 -0
  142. package/dist/sdk/models/operations/listplans.d.ts +53 -6
  143. package/dist/sdk/models/operations/listplans.js +59 -2
  144. package/dist/sdk/models/operations/listprices.d.ts +53 -0
  145. package/dist/sdk/models/operations/listprices.js +123 -0
  146. package/dist/sdk/models/operations/listsubscriptions.d.ts +48 -7
  147. package/dist/sdk/models/operations/listsubscriptions.js +56 -2
  148. package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +53 -0
  149. package/dist/sdk/models/operations/markinvoiceaspaid.js +123 -0
  150. package/dist/sdk/models/operations/ping.d.ts +39 -2
  151. package/dist/sdk/models/operations/ping.js +30 -2
  152. package/dist/sdk/models/operations/revertbackfill.d.ts +37 -0
  153. package/dist/sdk/models/operations/revertbackfill.js +28 -0
  154. package/dist/sdk/models/operations/scheduleplanchange.d.ts +37 -0
  155. package/dist/sdk/models/operations/scheduleplanchange.js +28 -0
  156. package/dist/sdk/models/operations/searchevents.d.ts +42 -7
  157. package/dist/sdk/models/operations/searchevents.js +47 -3
  158. package/dist/sdk/models/operations/triggerphase.d.ts +53 -0
  159. package/dist/sdk/models/operations/triggerphase.js +123 -0
  160. package/dist/sdk/models/operations/unschedulecancellation.d.ts +37 -0
  161. package/dist/sdk/models/operations/unschedulecancellation.js +28 -0
  162. package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +53 -0
  163. package/dist/sdk/models/operations/unschedulefixedfeequantity.js +123 -0
  164. package/dist/sdk/models/operations/unscheduleplanchange.d.ts +37 -0
  165. package/dist/sdk/models/operations/unscheduleplanchange.js +28 -0
  166. package/dist/sdk/models/operations/updatecustomer.d.ts +38 -4
  167. package/dist/sdk/models/operations/updatecustomer.js +30 -2
  168. package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +38 -1
  169. package/dist/sdk/models/operations/updatecustomerexternalid.js +30 -2
  170. package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +37 -0
  171. package/dist/sdk/models/operations/updatefixedfeequantity.js +28 -0
  172. package/dist/sdk/models/operations/updateplan.d.ts +53 -0
  173. package/dist/sdk/models/operations/updateplan.js +123 -0
  174. package/dist/sdk/models/operations/updateplanexternal.d.ts +53 -0
  175. package/dist/sdk/models/operations/updateplanexternal.js +123 -0
  176. package/dist/sdk/models/operations/voidinvoice.d.ts +36 -3
  177. package/dist/sdk/models/operations/voidinvoice.js +28 -4
  178. package/dist/sdk/models/shared/accountingprovider.d.ts +9 -0
  179. package/dist/sdk/models/shared/accountingprovider.js +55 -0
  180. package/dist/sdk/models/shared/accountingproviderconfig.d.ts +5 -0
  181. package/dist/sdk/models/shared/{creditblock.js → accountingproviderconfig.js} +10 -18
  182. package/dist/sdk/models/shared/accountingsyncconfiguration.d.ts +6 -0
  183. package/dist/sdk/models/shared/accountingsyncconfiguration.js +52 -0
  184. package/dist/sdk/models/shared/addamendmentcreditledgerentryrequestparams.d.ts +28 -0
  185. package/dist/sdk/models/shared/addamendmentcreditledgerentryrequestparams.js +81 -0
  186. package/dist/sdk/models/shared/adddecrementcreditledgerentryrequestparams.d.ts +24 -0
  187. package/dist/sdk/models/shared/adddecrementcreditledgerentryrequestparams.js +76 -0
  188. package/dist/sdk/models/shared/addeditpriceintervalparams.d.ts +13 -0
  189. package/dist/sdk/models/shared/addeditpriceintervalparams.js +54 -0
  190. package/dist/sdk/models/shared/addexpirationchangecreditledgerentryrequestparams.d.ts +37 -0
  191. package/dist/sdk/models/shared/{newcreditledgerentry.js → addexpirationchangecreditledgerentryrequestparams.js} +27 -34
  192. package/dist/sdk/models/shared/addincrementcreditledgerentryrequestparams.d.ts +42 -0
  193. package/dist/sdk/models/shared/addincrementcreditledgerentryrequestparams.js +109 -0
  194. package/dist/sdk/models/shared/addpriceintervalparams.d.ts +54 -0
  195. package/dist/sdk/models/shared/addpriceintervalparams.js +103 -0
  196. package/dist/sdk/models/shared/address.d.ts +9 -0
  197. package/dist/sdk/models/shared/address.js +70 -0
  198. package/dist/sdk/models/shared/addressinput.d.ts +9 -0
  199. package/dist/sdk/models/shared/addressinput.js +70 -0
  200. package/dist/sdk/models/shared/addvoidcreditledgerentryrequestparams.d.ts +38 -0
  201. package/dist/sdk/models/shared/addvoidcreditledgerentryrequestparams.js +93 -0
  202. package/dist/sdk/models/shared/affectedblock.d.ts +6 -0
  203. package/dist/sdk/models/shared/{credit.js → affectedblock.js} +9 -14
  204. package/dist/sdk/models/shared/{subscriptioncost.d.ts → aggregatedcost.d.ts} +1 -1
  205. package/dist/sdk/models/shared/{customercost.js → aggregatedcost.js} +11 -11
  206. package/dist/sdk/models/shared/amendedusage.d.ts +2 -7
  207. package/dist/sdk/models/shared/amendedusage.js +2 -14
  208. package/dist/sdk/models/shared/amendeventresult.d.ts +1 -4
  209. package/dist/sdk/models/shared/amendeventresult.js +0 -3
  210. package/dist/sdk/models/shared/amendmentledgerentry.d.ts +27 -0
  211. package/dist/sdk/models/shared/amendmentledgerentry.js +120 -0
  212. package/dist/sdk/models/shared/amountdiscount.d.ts +15 -0
  213. package/dist/sdk/models/shared/amountdiscount.js +59 -0
  214. package/dist/sdk/models/shared/amountdiscountcreationparams.d.ts +11 -0
  215. package/dist/sdk/models/shared/amountdiscountcreationparams.js +54 -0
  216. package/dist/sdk/models/shared/amountdiscountinterval.d.ts +27 -0
  217. package/dist/sdk/models/shared/amountdiscountinterval.js +82 -0
  218. package/dist/sdk/models/shared/autocollection.d.ts +3 -6
  219. package/dist/sdk/models/shared/autocollection.js +0 -3
  220. package/dist/sdk/models/shared/backfill.d.ts +2 -2
  221. package/dist/sdk/models/shared/backfills.d.ts +2 -5
  222. package/dist/sdk/models/shared/backfills.js +0 -3
  223. package/dist/sdk/models/shared/billablemetric.d.ts +24 -1
  224. package/dist/sdk/models/shared/billablemetric.js +40 -1
  225. package/dist/sdk/models/shared/billablemetrics.d.ts +7 -0
  226. package/dist/sdk/models/shared/billablemetrics.js +54 -0
  227. package/dist/sdk/models/shared/billablemetricsimple.d.ts +5 -0
  228. package/dist/sdk/models/shared/{billablemetricminified.js → billablemetricsimple.js} +8 -8
  229. package/dist/sdk/models/shared/billablemetrictiny.d.ts +4 -0
  230. package/dist/sdk/models/shared/billablemetrictiny.js +45 -0
  231. package/dist/sdk/models/shared/billingcyclealignment.d.ts +8 -0
  232. package/dist/sdk/models/shared/billingcyclealignment.js +15 -0
  233. package/dist/sdk/models/shared/bpsconfig.d.ts +7 -4
  234. package/dist/sdk/models/shared/bpsconfig.js +1 -4
  235. package/dist/sdk/models/shared/bpsprice.d.ts +242 -0
  236. package/dist/sdk/models/shared/bpsprice.js +363 -0
  237. package/dist/sdk/models/shared/bpstier.d.ts +15 -3
  238. package/dist/sdk/models/shared/bpstier.js +1 -1
  239. package/dist/sdk/models/shared/bulkbpsconfig.d.ts +4 -4
  240. package/dist/sdk/models/shared/bulkbpsconfig.js +0 -3
  241. package/dist/sdk/models/shared/bulkbpsprice.d.ts +242 -0
  242. package/dist/sdk/models/shared/bulkbpsprice.js +363 -0
  243. package/dist/sdk/models/shared/bulkbpstier.d.ts +10 -1
  244. package/dist/sdk/models/shared/bulkbpstier.js +1 -1
  245. package/dist/sdk/models/shared/bulkconfig.d.ts +4 -4
  246. package/dist/sdk/models/shared/bulkconfig.js +0 -3
  247. package/dist/sdk/models/shared/bulkprice.d.ts +242 -0
  248. package/dist/sdk/models/shared/bulkprice.js +363 -0
  249. package/dist/sdk/models/shared/bulktier.d.ts +7 -1
  250. package/dist/sdk/models/shared/bulktier.js +1 -1
  251. package/dist/sdk/models/shared/cancelsubscriptionparams.d.ts +19 -0
  252. package/dist/sdk/models/shared/cancelsubscriptionparams.js +63 -0
  253. package/dist/sdk/models/shared/changeoption.d.ts +0 -3
  254. package/dist/sdk/models/shared/changeoption.js +0 -3
  255. package/dist/sdk/models/shared/coupon.d.ts +14 -10
  256. package/dist/sdk/models/shared/coupon.js +16 -6
  257. package/dist/sdk/models/shared/couponredemption.d.ts +6 -0
  258. package/dist/sdk/models/shared/{usageitem.js → couponredemption.js} +12 -12
  259. package/dist/sdk/models/shared/coupons.d.ts +2 -5
  260. package/dist/sdk/models/shared/coupons.js +0 -3
  261. package/dist/sdk/models/shared/{newinvoicelineitem.d.ts → createinvoicelineitemparams.d.ts} +5 -5
  262. package/dist/sdk/models/shared/{newinvoicelineitem.js → createinvoicelineitemparams.js} +15 -13
  263. package/dist/sdk/models/shared/createoneoffinvoiceparams.d.ts +33 -0
  264. package/dist/sdk/models/shared/createoneoffinvoiceparams.js +86 -0
  265. package/dist/sdk/models/shared/creditblockexpiryledgerentry.d.ts +27 -0
  266. package/dist/sdk/models/shared/creditblockexpiryledgerentry.js +120 -0
  267. package/dist/sdk/models/shared/creditledgerentries.d.ts +1 -5
  268. package/dist/sdk/models/shared/creditledgerentries.js +1 -6
  269. package/dist/sdk/models/shared/creditnote.d.ts +34 -22
  270. package/dist/sdk/models/shared/creditnote.js +44 -7
  271. package/dist/sdk/models/shared/creditnotelineitem.d.ts +12 -10
  272. package/dist/sdk/models/shared/creditnotelineitem.js +24 -10
  273. package/dist/sdk/models/shared/creditnoteminified.d.ts +7 -0
  274. package/dist/sdk/models/shared/creditnoteminified.js +45 -0
  275. package/dist/sdk/models/shared/creditnotes.d.ts +2 -5
  276. package/dist/sdk/models/shared/creditnotes.js +0 -3
  277. package/dist/sdk/models/shared/{sublineitem2.d.ts → creditnotesublineitem.d.ts} +1 -1
  278. package/dist/sdk/models/shared/{sublineitem2.js → creditnotesublineitem.js} +9 -9
  279. package/dist/sdk/models/shared/creditnotesummary.d.ts +9 -6
  280. package/dist/sdk/models/shared/customer.d.ts +30 -181
  281. package/dist/sdk/models/shared/customer.js +41 -223
  282. package/dist/sdk/models/shared/customerbalancetransaction.d.ts +13 -28
  283. package/dist/sdk/models/shared/customerbalancetransaction.js +18 -42
  284. package/dist/sdk/models/shared/{transactions.d.ts → customerbalancetransactions.d.ts} +3 -6
  285. package/dist/sdk/models/shared/{transactions.js → customerbalancetransactions.js} +8 -11
  286. package/dist/sdk/models/shared/customercosts.d.ts +2 -5
  287. package/dist/sdk/models/shared/customercosts.js +3 -6
  288. package/dist/sdk/models/shared/customercreditbalance.d.ts +7 -0
  289. package/dist/sdk/models/shared/customercreditbalance.js +64 -0
  290. package/dist/sdk/models/shared/customercreditbalances.d.ts +7 -0
  291. package/dist/sdk/models/shared/customercreditbalances.js +54 -0
  292. package/dist/sdk/models/shared/customerminified.d.ts +0 -3
  293. package/dist/sdk/models/shared/customerminified.js +0 -3
  294. package/dist/sdk/models/shared/customers.d.ts +0 -3
  295. package/dist/sdk/models/shared/customers.js +0 -3
  296. package/dist/sdk/models/shared/customertaxid.d.ts +6 -0
  297. package/dist/sdk/models/shared/{newtransaction.js → customertaxid.js} +12 -13
  298. package/dist/sdk/models/shared/debug.d.ts +2 -2
  299. package/dist/sdk/models/shared/decrementledgerentry.d.ts +30 -0
  300. package/dist/sdk/models/shared/{creditledgerentry.js → decrementledgerentry.js} +42 -51
  301. package/dist/sdk/models/shared/deletecustomerresponse.d.ts +3 -0
  302. package/dist/sdk/models/shared/deletecustomerresponse.js +30 -0
  303. package/dist/sdk/models/shared/deprecatedeventresult.d.ts +1 -4
  304. package/dist/sdk/models/shared/deprecatedeventresult.js +0 -3
  305. package/dist/sdk/models/shared/discount.d.ts +13 -5
  306. package/dist/sdk/models/shared/discount.js +13 -4
  307. package/dist/sdk/models/shared/duplicateconstraintviolationerror.d.ts +16 -0
  308. package/dist/sdk/models/shared/duplicateconstraintviolationerror.js +82 -0
  309. package/dist/sdk/models/shared/duplicateresourcecreationerror.d.ts +16 -0
  310. package/dist/sdk/models/shared/duplicateresourcecreationerror.js +82 -0
  311. package/dist/sdk/models/shared/editcustomer.d.ts +72 -0
  312. package/dist/sdk/models/shared/editcustomer.js +151 -0
  313. package/dist/sdk/models/shared/editplan.d.ts +10 -0
  314. package/dist/sdk/models/shared/editplan.js +59 -0
  315. package/dist/sdk/models/shared/editpriceintervalparams.d.ts +34 -0
  316. package/dist/sdk/models/shared/editpriceintervalparams.js +78 -0
  317. package/dist/sdk/models/shared/event.d.ts +11 -4
  318. package/dist/sdk/models/shared/event.js +14 -3
  319. package/dist/sdk/models/shared/{credits.d.ts → events.d.ts} +3 -6
  320. package/dist/sdk/models/shared/{eventsearchresults.js → events.js} +8 -11
  321. package/dist/sdk/models/shared/expirationchangeledgerentry.d.ts +28 -0
  322. package/dist/sdk/models/shared/expirationchangeledgerentry.js +129 -0
  323. package/dist/sdk/models/shared/featurenotavailableerror.d.ts +16 -0
  324. package/dist/sdk/models/shared/featurenotavailableerror.js +82 -0
  325. package/dist/sdk/models/shared/fivehundrederror.d.ts +13 -0
  326. package/dist/sdk/models/shared/fivehundrederror.js +78 -0
  327. package/dist/sdk/models/shared/fivetranexampleprice.d.ts +241 -0
  328. package/dist/sdk/models/shared/fivetranexampleprice.js +361 -0
  329. package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +12 -5
  330. package/dist/sdk/models/shared/fixedfeequantitychange.js +12 -3
  331. package/dist/sdk/models/shared/fixedfeequantityscheduleentry.d.ts +7 -0
  332. package/dist/sdk/models/shared/{fixedfeequantityschedule.js → fixedfeequantityscheduleentry.js} +10 -10
  333. package/dist/sdk/models/shared/fixedfeequantitytransition.d.ts +6 -0
  334. package/dist/sdk/models/shared/fixedfeequantitytransition.js +59 -0
  335. package/dist/sdk/models/shared/fourhundredandoneerror.d.ts +16 -0
  336. package/dist/sdk/models/shared/fourhundredandoneerror.js +82 -0
  337. package/dist/sdk/models/shared/fourhundredandtwentynineerror.d.ts +16 -0
  338. package/dist/sdk/models/shared/fourhundredandtwentynineerror.js +82 -0
  339. package/dist/sdk/models/shared/groupedsubscriptionusage.d.ts +7 -0
  340. package/dist/sdk/models/shared/groupedsubscriptionusage.js +54 -0
  341. package/dist/sdk/models/shared/groupedsubscriptionusagerecord.d.ts +14 -0
  342. package/dist/sdk/models/shared/groupedsubscriptionusagerecord.js +71 -0
  343. package/dist/sdk/models/shared/idempotencyconflict.d.ts +16 -0
  344. package/dist/sdk/models/shared/idempotencyconflict.js +82 -0
  345. package/dist/sdk/models/shared/idempotencykeyvalidationerror.d.ts +17 -0
  346. package/dist/sdk/models/shared/idempotencykeyvalidationerror.js +87 -0
  347. package/dist/sdk/models/shared/idempotencyrequestmismatch.d.ts +16 -0
  348. package/dist/sdk/models/shared/idempotencyrequestmismatch.js +82 -0
  349. package/dist/sdk/models/shared/{invoicesettings.d.ts → incrementcreditledgerentryinvoicesettings.d.ts} +2 -2
  350. package/dist/sdk/models/shared/{invoicesettings.js → incrementcreditledgerentryinvoicesettings.js} +10 -10
  351. package/dist/sdk/models/shared/incrementledgerentry.d.ts +27 -0
  352. package/dist/sdk/models/shared/incrementledgerentry.js +120 -0
  353. package/dist/sdk/models/shared/index.d.ts +144 -54
  354. package/dist/sdk/models/shared/index.js +144 -54
  355. package/dist/sdk/models/shared/ingestevent.d.ts +32 -0
  356. package/dist/sdk/models/shared/ingestevent.js +86 -0
  357. package/dist/sdk/models/shared/ingestionresponse.d.ts +5 -5
  358. package/dist/sdk/models/shared/ingestionresponse.js +3 -6
  359. package/dist/sdk/models/shared/ingestrequestbody.d.ts +5 -0
  360. package/dist/sdk/models/shared/{tieredbpsconfig1.js → ingestrequestbody.js} +11 -11
  361. package/dist/sdk/models/shared/invoice.d.ts +46 -182
  362. package/dist/sdk/models/shared/invoice.js +70 -201
  363. package/dist/sdk/models/shared/invoicelineitem.d.ts +10 -168
  364. package/dist/sdk/models/shared/invoicelineitem.js +21 -303
  365. package/dist/sdk/models/shared/invoicelineitemparams.d.ts +27 -0
  366. package/dist/sdk/models/shared/invoicelineitemparams.js +92 -0
  367. package/dist/sdk/models/shared/invoiceminified.d.ts +7 -0
  368. package/dist/sdk/models/shared/invoiceminified.js +45 -0
  369. package/dist/sdk/models/shared/invoices.d.ts +2 -5
  370. package/dist/sdk/models/shared/invoices.js +0 -3
  371. package/dist/sdk/models/shared/item.d.ts +14 -0
  372. package/dist/sdk/models/shared/item.js +72 -0
  373. package/dist/sdk/models/shared/itemexternalconnection.d.ts +16 -0
  374. package/dist/sdk/models/shared/itemexternalconnection.js +63 -0
  375. package/dist/sdk/models/shared/items.d.ts +7 -0
  376. package/dist/sdk/models/shared/{credits.js → items.js} +11 -14
  377. package/dist/sdk/models/shared/itemslim.d.ts +5 -0
  378. package/dist/sdk/models/shared/itemslim.js +50 -0
  379. package/dist/sdk/models/shared/markaspaidrequestparams.d.ts +16 -0
  380. package/dist/sdk/models/shared/markaspaidrequestparams.js +61 -0
  381. package/dist/sdk/models/shared/matrixconfig.d.ts +12 -5
  382. package/dist/sdk/models/shared/matrixconfig.js +5 -3
  383. package/dist/sdk/models/shared/matrixprice.d.ts +242 -0
  384. package/dist/sdk/models/shared/matrixprice.js +363 -0
  385. package/dist/sdk/models/shared/matrixsublineitem.d.ts +17 -0
  386. package/dist/sdk/models/shared/matrixsublineitem.js +78 -0
  387. package/dist/sdk/models/shared/matrixvalue.d.ts +8 -1
  388. package/dist/sdk/models/shared/matrixvalue.js +5 -0
  389. package/dist/sdk/models/shared/maximum.d.ts +11 -0
  390. package/dist/sdk/models/shared/{subscriptionusage.js → maximum.js} +14 -14
  391. package/dist/sdk/models/shared/maximuminterval.d.ts +23 -0
  392. package/dist/sdk/models/shared/{subscriptioncost.js → maximuminterval.js} +21 -23
  393. package/dist/sdk/models/shared/metricgroup.d.ts +5 -0
  394. package/dist/sdk/models/shared/metricgroup.js +50 -0
  395. package/dist/sdk/models/shared/minimum.d.ts +11 -0
  396. package/dist/sdk/models/shared/minimum.js +50 -0
  397. package/dist/sdk/models/shared/minimuminterval.d.ts +23 -0
  398. package/dist/sdk/models/shared/minimuminterval.js +73 -0
  399. package/dist/sdk/models/shared/newaccountingsyncconfiguration.d.ts +6 -0
  400. package/dist/sdk/models/shared/newaccountingsyncconfiguration.js +52 -0
  401. package/dist/sdk/models/shared/newbackfill.d.ts +1 -1
  402. package/dist/sdk/models/shared/newbillablemetric.d.ts +28 -0
  403. package/dist/sdk/models/shared/newbillablemetric.js +77 -0
  404. package/dist/sdk/models/shared/newbpsprice.d.ts +53 -0
  405. package/dist/sdk/models/shared/newbpsprice.js +110 -0
  406. package/dist/sdk/models/shared/newbulkbpsprice.d.ts +53 -0
  407. package/dist/sdk/models/shared/newbulkbpsprice.js +110 -0
  408. package/dist/sdk/models/shared/newbulkprice.d.ts +53 -0
  409. package/dist/sdk/models/shared/newbulkprice.js +110 -0
  410. package/dist/sdk/models/shared/newcoupon.d.ts +4 -10
  411. package/dist/sdk/models/shared/newcoupon.js +11 -11
  412. package/dist/sdk/models/shared/newcustomer.d.ts +20 -154
  413. package/dist/sdk/models/shared/newcustomer.js +34 -206
  414. package/dist/sdk/models/shared/newcustomerbalancetransaction.d.ts +13 -0
  415. package/dist/sdk/models/shared/newcustomerbalancetransaction.js +60 -0
  416. package/dist/sdk/models/shared/newmatrixprice.d.ts +53 -0
  417. package/dist/sdk/models/shared/{sublineitem.js → newmatrixprice.js} +51 -43
  418. package/dist/sdk/models/shared/newpackageprice.d.ts +53 -0
  419. package/dist/sdk/models/shared/newpackageprice.js +110 -0
  420. package/dist/sdk/models/shared/newpackagewithallocationprice.d.ts +52 -0
  421. package/dist/sdk/models/shared/newpackagewithallocationprice.js +108 -0
  422. package/dist/sdk/models/shared/newplan.d.ts +26 -0
  423. package/dist/sdk/models/shared/newplan.js +93 -0
  424. package/dist/sdk/models/shared/newreportingconfiguration.d.ts +4 -0
  425. package/dist/sdk/models/shared/newreportingconfiguration.js +45 -0
  426. package/dist/sdk/models/shared/newsubscription.d.ts +18 -43
  427. package/dist/sdk/models/shared/newsubscription.js +50 -8
  428. package/dist/sdk/models/shared/newthresholdtotalamountprice.d.ts +52 -0
  429. package/dist/sdk/models/shared/newthresholdtotalamountprice.js +108 -0
  430. package/dist/sdk/models/shared/newtieredbpsprice.d.ts +53 -0
  431. package/dist/sdk/models/shared/newtieredbpsprice.js +110 -0
  432. package/dist/sdk/models/shared/newtieredpackageprice.d.ts +52 -0
  433. package/dist/sdk/models/shared/newtieredpackageprice.js +108 -0
  434. package/dist/sdk/models/shared/newtieredprice.d.ts +53 -0
  435. package/dist/sdk/models/shared/newtieredprice.js +110 -0
  436. package/dist/sdk/models/shared/newtieredwithminimumprice.d.ts +52 -0
  437. package/dist/sdk/models/shared/newtieredwithminimumprice.js +108 -0
  438. package/dist/sdk/models/shared/newunitprice.d.ts +53 -0
  439. package/dist/sdk/models/shared/newunitprice.js +110 -0
  440. package/dist/sdk/models/shared/othersublineitem.d.ts +15 -0
  441. package/dist/sdk/models/shared/othersublineitem.js +71 -0
  442. package/dist/sdk/models/shared/overridebpsprice.d.ts +27 -0
  443. package/dist/sdk/models/shared/{bpspriceoverride.js → overridebpsprice.js} +27 -18
  444. package/dist/sdk/models/shared/overridebulkbpsprice.d.ts +27 -0
  445. package/dist/sdk/models/shared/{bulkbpspriceoverride.js → overridebulkbpsprice.js} +27 -18
  446. package/dist/sdk/models/shared/overridebulkprice.d.ts +27 -0
  447. package/dist/sdk/models/shared/{bulkpriceoverride.js → overridebulkprice.js} +27 -18
  448. package/dist/sdk/models/shared/overridefivetranexampleprice.d.ts +26 -0
  449. package/dist/sdk/models/shared/overridefivetranexampleprice.js +81 -0
  450. package/dist/sdk/models/shared/overridematrixprice.d.ts +27 -0
  451. package/dist/sdk/models/shared/overridematrixprice.js +83 -0
  452. package/dist/sdk/models/shared/overridepackageprice.d.ts +27 -0
  453. package/dist/sdk/models/shared/{packagepriceoverride.js → overridepackageprice.js} +27 -18
  454. package/dist/sdk/models/shared/overridepackagewithallocationprice.d.ts +26 -0
  455. package/dist/sdk/models/shared/overridepackagewithallocationprice.js +81 -0
  456. package/dist/sdk/models/shared/overridetestratingfunctionprice.d.ts +26 -0
  457. package/dist/sdk/models/shared/overridetestratingfunctionprice.js +81 -0
  458. package/dist/sdk/models/shared/overridethresholdtotalamountprice.d.ts +26 -0
  459. package/dist/sdk/models/shared/overridethresholdtotalamountprice.js +81 -0
  460. package/dist/sdk/models/shared/overridetieredbpsprice.d.ts +27 -0
  461. package/dist/sdk/models/shared/{tieredbpspriceoverride.js → overridetieredbpsprice.js} +30 -21
  462. package/dist/sdk/models/shared/overridetieredpackageprice.d.ts +26 -0
  463. package/dist/sdk/models/shared/overridetieredpackageprice.js +81 -0
  464. package/dist/sdk/models/shared/overridetieredprice.d.ts +27 -0
  465. package/dist/sdk/models/shared/{tieredpriceoverride.js → overridetieredprice.js} +27 -18
  466. package/dist/sdk/models/shared/overridetieredwithminimumprice.d.ts +26 -0
  467. package/dist/sdk/models/shared/overridetieredwithminimumprice.js +81 -0
  468. package/dist/sdk/models/shared/overrideunitprice.d.ts +27 -0
  469. package/dist/sdk/models/shared/{unitpriceoverride.js → overrideunitprice.js} +27 -18
  470. package/dist/sdk/models/shared/packageconfig.d.ts +7 -4
  471. package/dist/sdk/models/shared/packageconfig.js +0 -3
  472. package/dist/sdk/models/shared/packageprice.d.ts +242 -0
  473. package/dist/sdk/models/shared/packageprice.js +363 -0
  474. package/dist/sdk/models/shared/packagewithallocationprice.d.ts +241 -0
  475. package/dist/sdk/models/shared/packagewithallocationprice.js +361 -0
  476. package/dist/sdk/models/shared/percentagediscount.d.ts +15 -0
  477. package/dist/sdk/models/shared/percentagediscount.js +59 -0
  478. package/dist/sdk/models/shared/percentagediscountcreationparams.d.ts +11 -0
  479. package/dist/sdk/models/shared/percentagediscountcreationparams.js +54 -0
  480. package/dist/sdk/models/shared/percentagediscountinterval.d.ts +27 -0
  481. package/dist/sdk/models/shared/percentagediscountinterval.js +82 -0
  482. package/dist/sdk/models/shared/perpricecost.d.ts +206 -6
  483. package/dist/sdk/models/shared/perpricecost.js +6 -6
  484. package/dist/sdk/models/shared/phaseoverride.d.ts +7 -30
  485. package/dist/sdk/models/shared/phaseoverride.js +4 -42
  486. package/dist/sdk/models/shared/{availability.d.ts → pingresponse.d.ts} +1 -4
  487. package/dist/sdk/models/shared/{availability.js → pingresponse.js} +7 -10
  488. package/dist/sdk/models/shared/plan.d.ts +29 -62
  489. package/dist/sdk/models/shared/plan.js +55 -108
  490. package/dist/sdk/models/shared/planminified.d.ts +6 -2
  491. package/dist/sdk/models/shared/planminified.js +5 -0
  492. package/dist/sdk/models/shared/planphase.d.ts +18 -58
  493. package/dist/sdk/models/shared/planphase.js +30 -86
  494. package/dist/sdk/models/shared/plans.d.ts +2 -5
  495. package/dist/sdk/models/shared/plans.js +0 -3
  496. package/dist/sdk/models/shared/pricegroup.d.ts +2 -2
  497. package/dist/sdk/models/shared/priceinterval.d.ts +239 -0
  498. package/dist/sdk/models/shared/priceinterval.js +104 -0
  499. package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.d.ts +11 -0
  500. package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.js +54 -0
  501. package/dist/sdk/models/shared/prices.d.ts +6 -0
  502. package/dist/sdk/models/shared/prices.js +52 -0
  503. package/dist/sdk/models/shared/reportingconfiguration.d.ts +4 -0
  504. package/dist/sdk/models/shared/reportingconfiguration.js +45 -0
  505. package/dist/sdk/models/shared/requesttoolargeerror.d.ts +16 -0
  506. package/dist/sdk/models/shared/requesttoolargeerror.js +82 -0
  507. package/dist/sdk/models/shared/requestvalidationerror.d.ts +14 -17
  508. package/dist/sdk/models/shared/requestvalidationerror.js +29 -7
  509. package/dist/sdk/models/shared/resourcenotfounderror.d.ts +16 -0
  510. package/dist/sdk/models/shared/resourcenotfounderror.js +82 -0
  511. package/dist/sdk/models/shared/resourcetoolargeerror.d.ts +16 -0
  512. package/dist/sdk/models/shared/resourcetoolargeerror.js +82 -0
  513. package/dist/sdk/models/shared/sublineitemgrouping.d.ts +8 -0
  514. package/dist/sdk/models/shared/{grouping.js → sublineitemgrouping.js} +8 -11
  515. package/dist/sdk/models/shared/sublineitemmatrixconfig.d.ts +7 -0
  516. package/dist/sdk/models/shared/{matrixconfig1.js → sublineitemmatrixconfig.js} +7 -10
  517. package/dist/sdk/models/shared/subscription.d.ts +64 -31
  518. package/dist/sdk/models/shared/subscription.js +61 -42
  519. package/dist/sdk/models/shared/subscriptioncosts.d.ts +2 -5
  520. package/dist/sdk/models/shared/subscriptioncosts.js +3 -6
  521. package/dist/sdk/models/shared/subscriptionminified.d.ts +0 -3
  522. package/dist/sdk/models/shared/subscriptionminified.js +0 -3
  523. package/dist/sdk/models/shared/subscriptionplanchange.d.ts +20 -15
  524. package/dist/sdk/models/shared/subscriptionplanchange.js +37 -15
  525. package/dist/sdk/models/shared/subscriptions.d.ts +2 -5
  526. package/dist/sdk/models/shared/subscriptions.js +0 -3
  527. package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +3 -3
  528. package/dist/sdk/models/shared/{subscriptionschedule.d.ts → subscriptionscheduleitems.d.ts} +3 -6
  529. package/dist/sdk/models/shared/{subscriptionschedule.js → subscriptionscheduleitems.js} +8 -11
  530. package/dist/sdk/models/shared/subscriptiontrialinfo.d.ts +4 -0
  531. package/dist/sdk/models/shared/{subscriptioncancellation.js → subscriptiontrialinfo.js} +8 -14
  532. package/dist/sdk/models/shared/testratingfunctionprice.d.ts +241 -0
  533. package/dist/sdk/models/shared/testratingfunctionprice.js +361 -0
  534. package/dist/sdk/models/shared/thresholdtotalamountprice.d.ts +241 -0
  535. package/dist/sdk/models/shared/thresholdtotalamountprice.js +361 -0
  536. package/dist/sdk/models/shared/tier.d.ts +11 -2
  537. package/dist/sdk/models/shared/tier.js +2 -2
  538. package/dist/sdk/models/shared/tierconfig.d.ts +2 -5
  539. package/dist/sdk/models/shared/tierconfig.js +2 -5
  540. package/dist/sdk/models/shared/tieredbpsconfig.d.ts +4 -4
  541. package/dist/sdk/models/shared/tieredbpsconfig.js +0 -3
  542. package/dist/sdk/models/shared/tieredbpsprice.d.ts +242 -0
  543. package/dist/sdk/models/shared/tieredbpsprice.js +363 -0
  544. package/dist/sdk/models/shared/tieredconfig.d.ts +4 -4
  545. package/dist/sdk/models/shared/tieredconfig.js +0 -3
  546. package/dist/sdk/models/shared/tieredpackageprice.d.ts +241 -0
  547. package/dist/sdk/models/shared/tieredpackageprice.js +361 -0
  548. package/dist/sdk/models/shared/tieredprice.d.ts +242 -0
  549. package/dist/sdk/models/shared/tieredprice.js +363 -0
  550. package/dist/sdk/models/shared/tieredwithminimumprice.d.ts +241 -0
  551. package/dist/sdk/models/shared/tieredwithminimumprice.js +361 -0
  552. package/dist/sdk/models/shared/tiersublineitem.d.ts +17 -0
  553. package/dist/sdk/models/shared/{sublineitem1.js → tiersublineitem.js} +21 -18
  554. package/dist/sdk/models/shared/trialconfig.d.ts +1 -1
  555. package/dist/sdk/models/shared/trialdiscount.d.ts +19 -0
  556. package/dist/sdk/models/shared/trialdiscount.js +64 -0
  557. package/dist/sdk/models/shared/triggersubscriptionphaseparams.d.ts +8 -0
  558. package/dist/sdk/models/shared/triggersubscriptionphaseparams.js +51 -0
  559. package/dist/sdk/models/shared/ungroupedsubscriptionusage.d.ts +5 -0
  560. package/dist/sdk/models/shared/ungroupedsubscriptionusage.js +47 -0
  561. package/dist/sdk/models/shared/ungroupedsubscriptionusagerecord.d.ts +12 -0
  562. package/dist/sdk/models/shared/ungroupedsubscriptionusagerecord.js +64 -0
  563. package/dist/sdk/models/shared/unitconfig.d.ts +8 -4
  564. package/dist/sdk/models/shared/unitconfig.js +5 -3
  565. package/dist/sdk/models/shared/unitprice.d.ts +242 -0
  566. package/dist/sdk/models/shared/unitprice.js +363 -0
  567. package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.d.ts +7 -0
  568. package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.js +45 -0
  569. package/dist/sdk/models/shared/upcominginvoice.d.ts +89 -54
  570. package/dist/sdk/models/shared/upcominginvoice.js +216 -88
  571. package/dist/sdk/models/shared/updateevent.d.ts +1 -1
  572. package/dist/sdk/models/shared/updateevent.js +5 -1
  573. package/dist/sdk/models/shared/urlnotfound.d.ts +16 -0
  574. package/dist/sdk/models/shared/urlnotfound.js +82 -0
  575. package/dist/sdk/models/shared/usage.d.ts +3 -10
  576. package/dist/sdk/models/shared/usage.js +18 -24
  577. package/dist/sdk/models/shared/usagediscount.d.ts +15 -0
  578. package/dist/sdk/models/shared/{tier7.js → usagediscount.js} +18 -19
  579. package/dist/sdk/models/shared/usagediscountcreationparams.d.ts +11 -0
  580. package/dist/sdk/models/shared/usagediscountcreationparams.js +54 -0
  581. package/dist/sdk/models/shared/usagediscountinterval.d.ts +27 -0
  582. package/dist/sdk/models/shared/usagediscountinterval.js +82 -0
  583. package/dist/sdk/models/shared/validationerror.d.ts +11 -0
  584. package/dist/sdk/models/shared/validationerror.js +50 -0
  585. package/dist/sdk/models/shared/voidinitiatedledgerentry.d.ts +30 -0
  586. package/dist/sdk/models/shared/voidinitiatedledgerentry.js +139 -0
  587. package/dist/sdk/models/shared/voidledgerentry.d.ts +29 -0
  588. package/dist/sdk/models/shared/voidledgerentry.js +130 -0
  589. package/dist/sdk/plan.d.ts +54 -186
  590. package/dist/sdk/plan.js +656 -202
  591. package/dist/sdk/price.d.ts +246 -0
  592. package/dist/sdk/price.js +790 -0
  593. package/dist/sdk/priceinterval.d.ts +65 -0
  594. package/dist/sdk/priceinterval.js +281 -0
  595. package/dist/sdk/sdk.d.ts +149 -58
  596. package/dist/sdk/sdk.js +23 -40
  597. package/dist/sdk/subscription.d.ts +435 -280
  598. package/dist/sdk/subscription.js +1516 -350
  599. package/docs/models/operations/addeditpriceintervalsrequest.md +9 -0
  600. package/docs/models/operations/addeditpriceintervalsresponse.md +18 -0
  601. package/docs/models/operations/amendeventrequest.md +9 -0
  602. package/docs/models/operations/amendeventresponse.md +18 -0
  603. package/docs/models/operations/amendusageexternalcustomeridrequest.md +11 -0
  604. package/docs/models/operations/amendusageexternalcustomeridresponse.md +18 -0
  605. package/docs/models/operations/amendusagerequest.md +11 -0
  606. package/docs/models/operations/amendusageresponse.md +18 -0
  607. package/docs/models/operations/archivecouponrequest.md +8 -0
  608. package/docs/models/operations/archivecouponresponse.md +18 -0
  609. package/docs/models/operations/cancelsubscriptionrequest.md +9 -0
  610. package/docs/models/operations/cancelsubscriptionresponse.md +18 -0
  611. package/docs/models/operations/closebackfillrequest.md +8 -0
  612. package/docs/models/operations/closebackfillresponse.md +18 -0
  613. package/docs/models/operations/createbackfillresponse.md +18 -0
  614. package/docs/models/operations/createcouponresponse.md +18 -0
  615. package/docs/models/operations/createcustomerbalancetransactionrequest.md +9 -0
  616. package/docs/models/operations/createcustomerbalancetransactionresponse.md +18 -0
  617. package/docs/models/operations/createcustomerresponse.md +18 -0
  618. package/docs/models/operations/createinvoicelineitemresponse.md +18 -0
  619. package/docs/models/operations/createinvoiceresponse.md +18 -0
  620. package/docs/models/operations/createledgerentryexternalidrequest.md +9 -0
  621. package/docs/models/operations/createledgerentryexternalidresponse.md +18 -0
  622. package/docs/models/operations/createledgerentryrequest.md +9 -0
  623. package/docs/models/operations/createledgerentryresponse.md +18 -0
  624. package/docs/models/operations/createmetricresponse.md +18 -0
  625. package/docs/models/operations/createplanresponse.md +18 -0
  626. package/docs/models/operations/createpriceresponse.md +18 -0
  627. package/docs/models/operations/createsubscriptionresponse.md +18 -0
  628. package/docs/models/operations/deletecustomerrequest.md +8 -0
  629. package/docs/models/operations/deletecustomerresponse.md +18 -0
  630. package/docs/models/operations/deprecateeventrequest.md +8 -0
  631. package/docs/models/operations/deprecateeventresponse.md +18 -0
  632. package/docs/models/operations/fetchbackfillrequest.md +8 -0
  633. package/docs/models/operations/fetchbackfillresponse.md +18 -0
  634. package/docs/models/operations/fetchcouponrequest.md +8 -0
  635. package/docs/models/operations/fetchcouponresponse.md +18 -0
  636. package/docs/models/operations/fetchcreditnoterequest.md +8 -0
  637. package/docs/models/operations/fetchcreditnoteresponse.md +18 -0
  638. package/docs/models/operations/fetchcustomercostsexternalidrequest.md +12 -0
  639. package/docs/models/operations/fetchcustomercostsexternalidresponse.md +18 -0
  640. package/docs/models/operations/fetchcustomercostsexternalidviewmodeviewmode.md +11 -0
  641. package/docs/models/operations/fetchcustomercostsrequest.md +12 -0
  642. package/docs/models/operations/fetchcustomercostsresponse.md +18 -0
  643. package/docs/models/operations/fetchcustomercostsviewmodeviewmode.md +11 -0
  644. package/docs/models/operations/fetchcustomercreditsexternalidrequest.md +10 -0
  645. package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +18 -0
  646. package/docs/models/operations/fetchcustomercreditsledgerentrystatusentrystatus.md +9 -0
  647. package/docs/models/operations/fetchcustomercreditsledgerentrytypeentrytype.md +14 -0
  648. package/docs/models/operations/fetchcustomercreditsledgerexternalidentrystatusentrystatus.md +9 -0
  649. package/docs/models/operations/fetchcustomercreditsledgerexternalidentrytypeentrytype.md +14 -0
  650. package/docs/models/operations/fetchcustomercreditsledgerexternalidrequest.md +18 -0
  651. package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +18 -0
  652. package/docs/models/operations/fetchcustomercreditsledgerrequest.md +18 -0
  653. package/docs/models/operations/fetchcustomercreditsledgerresponse.md +18 -0
  654. package/docs/models/operations/fetchcustomercreditsrequest.md +10 -0
  655. package/docs/models/operations/fetchcustomercreditsresponse.md +18 -0
  656. package/docs/models/operations/fetchcustomerexternalidrequest.md +8 -0
  657. package/docs/models/operations/fetchcustomerexternalidresponse.md +18 -0
  658. package/docs/models/operations/fetchcustomerrequest.md +8 -0
  659. package/docs/models/operations/fetchcustomerresponse.md +18 -0
  660. package/docs/models/operations/fetchinvoicerequest.md +8 -0
  661. package/docs/models/operations/fetchinvoiceresponse.md +18 -0
  662. package/docs/models/operations/fetchitemrequest.md +8 -0
  663. package/docs/models/operations/fetchitemresponse.md +18 -0
  664. package/docs/models/operations/fetchmetricrequest.md +8 -0
  665. package/docs/models/operations/fetchmetricresponse.md +18 -0
  666. package/docs/models/operations/fetchplanexternalidrequest.md +8 -0
  667. package/docs/models/operations/fetchplanexternalidresponse.md +18 -0
  668. package/docs/models/operations/fetchplanrequest.md +8 -0
  669. package/docs/models/operations/fetchplanresponse.md +18 -0
  670. package/docs/models/operations/fetchpriceexternalidrequest.md +8 -0
  671. package/docs/models/operations/fetchpriceexternalidresponse.md +18 -0
  672. package/docs/models/operations/fetchpricerequest.md +8 -0
  673. package/docs/models/operations/fetchpriceresponse.md +18 -0
  674. package/docs/models/operations/fetchsubscriptioncostsrequest.md +12 -0
  675. package/docs/models/operations/fetchsubscriptioncostsresponse.md +18 -0
  676. package/docs/models/operations/fetchsubscriptioncostsviewmodeviewmode.md +11 -0
  677. package/docs/models/operations/fetchsubscriptionrequest.md +8 -0
  678. package/docs/models/operations/fetchsubscriptionresponse.md +18 -0
  679. package/docs/models/operations/fetchsubscriptionschedulerequest.md +14 -0
  680. package/docs/models/operations/fetchsubscriptionscheduleresponse.md +18 -0
  681. package/docs/models/operations/fetchsubscriptionusagegranularitygranularity.md +10 -0
  682. package/docs/models/operations/fetchsubscriptionusagerequest.md +20 -0
  683. package/docs/models/operations/fetchsubscriptionusageresponse.md +18 -0
  684. package/docs/models/operations/fetchsubscriptionusageviewmodeviewmode.md +11 -0
  685. package/docs/models/operations/fetchupcominginvoicerequest.md +8 -0
  686. package/docs/models/operations/fetchupcominginvoiceresponse.md +18 -0
  687. package/docs/models/operations/ingestrequest.md +10 -0
  688. package/docs/models/operations/ingestresponse.md +18 -0
  689. package/docs/models/operations/issueinvoicerequest.md +8 -0
  690. package/docs/models/operations/issueinvoiceresponse.md +18 -0
  691. package/docs/models/operations/listbackfillsrequest.md +9 -0
  692. package/docs/models/operations/listbackfillsresponse.md +18 -0
  693. package/docs/models/operations/listbalancetransactionsrequest.md +14 -0
  694. package/docs/models/operations/listbalancetransactionsresponse.md +18 -0
  695. package/docs/models/operations/listcouponsrequest.md +11 -0
  696. package/docs/models/operations/listcouponsresponse.md +18 -0
  697. package/docs/models/operations/listcouponsubscriptionsrequest.md +10 -0
  698. package/docs/models/operations/listcouponsubscriptionsresponse.md +18 -0
  699. package/docs/models/operations/listcreditnotesrequest.md +9 -0
  700. package/docs/models/operations/listcreditnotesresponse.md +18 -0
  701. package/docs/models/operations/listcustomersrequest.md +13 -0
  702. package/docs/models/operations/listcustomersresponse.md +18 -0
  703. package/docs/models/operations/listinvoicesdatetypedatetype.md +9 -0
  704. package/docs/models/operations/listinvoicesrequest.md +27 -0
  705. package/docs/models/operations/listinvoicesresponse.md +18 -0
  706. package/docs/models/operations/listinvoicesstatus.md +12 -0
  707. package/docs/models/operations/listinvoicesstatusstatus.md +12 -0
  708. package/docs/models/operations/listitemsrequest.md +9 -0
  709. package/docs/models/operations/listitemsresponse.md +18 -0
  710. package/docs/models/operations/listmetricsrequest.md +13 -0
  711. package/docs/models/operations/listmetricsresponse.md +18 -0
  712. package/docs/models/operations/listplansrequest.md +14 -0
  713. package/docs/models/operations/listplansresponse.md +18 -0
  714. package/docs/models/operations/listplansstatusstatus.md +12 -0
  715. package/docs/models/operations/listpricesrequest.md +9 -0
  716. package/docs/models/operations/listpricesresponse.md +18 -0
  717. package/docs/models/operations/listsubscriptionsrequest.md +16 -0
  718. package/docs/models/operations/listsubscriptionsresponse.md +18 -0
  719. package/docs/models/operations/listsubscriptionsstatusstatus.md +10 -0
  720. package/docs/models/operations/markinvoiceaspaidrequest.md +9 -0
  721. package/docs/models/operations/markinvoiceaspaidresponse.md +18 -0
  722. package/docs/models/operations/pingresponse.md +18 -0
  723. package/docs/models/operations/revertbackfillrequest.md +8 -0
  724. package/docs/models/operations/revertbackfillresponse.md +18 -0
  725. package/docs/models/operations/scheduleplanchangerequest.md +9 -0
  726. package/docs/models/operations/scheduleplanchangeresponse.md +18 -0
  727. package/docs/models/operations/searcheventsrequest.md +14 -0
  728. package/docs/models/operations/searcheventsresponse.md +18 -0
  729. package/docs/models/operations/triggerphaserequest.md +9 -0
  730. package/docs/models/operations/triggerphaseresponse.md +18 -0
  731. package/docs/models/operations/unschedulecancellationrequest.md +8 -0
  732. package/docs/models/operations/unschedulecancellationresponse.md +18 -0
  733. package/docs/models/operations/unschedulefixedfeequantityrequest.md +9 -0
  734. package/docs/models/operations/unschedulefixedfeequantityresponse.md +18 -0
  735. package/docs/models/operations/unscheduleplanchangerequest.md +8 -0
  736. package/docs/models/operations/unscheduleplanchangeresponse.md +18 -0
  737. package/docs/models/operations/updatecustomerexternalidrequest.md +9 -0
  738. package/docs/models/operations/updatecustomerexternalidresponse.md +18 -0
  739. package/docs/models/operations/updatecustomerrequest.md +9 -0
  740. package/docs/models/operations/updatecustomerresponse.md +18 -0
  741. package/docs/models/operations/updatefixedfeequantityrequest.md +9 -0
  742. package/docs/models/operations/updatefixedfeequantityresponse.md +18 -0
  743. package/docs/models/operations/updateplanexternalrequest.md +9 -0
  744. package/docs/models/operations/updateplanexternalresponse.md +18 -0
  745. package/docs/models/operations/updateplanrequest.md +9 -0
  746. package/docs/models/operations/updateplanresponse.md +18 -0
  747. package/docs/models/operations/voidinvoicerequest.md +8 -0
  748. package/docs/models/operations/voidinvoiceresponse.md +18 -0
  749. package/docs/models/shared/accountingprovider.md +9 -0
  750. package/docs/models/shared/accountingproviderconfig.md +9 -0
  751. package/docs/models/shared/accountingproviderprovidertype.md +9 -0
  752. package/docs/models/shared/accountingsyncconfiguration.md +9 -0
  753. package/docs/models/shared/addamendmentcreditledgerentryrequestparams.md +12 -0
  754. package/docs/models/shared/addamendmentcreditledgerentryrequestparamsentrytype.md +8 -0
  755. package/docs/models/shared/addamendmentcreditledgerentryrequestparamsmetadata.md +9 -0
  756. package/docs/models/shared/adddecrementcreditledgerentryrequestparams.md +11 -0
  757. package/docs/models/shared/adddecrementcreditledgerentryrequestparamsentrytype.md +8 -0
  758. package/docs/models/shared/adddecrementcreditledgerentryrequestparamsmetadata.md +9 -0
  759. package/docs/models/shared/addeditpriceintervalparams.md +9 -0
  760. package/docs/models/shared/addexpirationchangecreditledgerentryrequestparams.md +14 -0
  761. package/docs/models/shared/addexpirationchangecreditledgerentryrequestparamsentrytype.md +8 -0
  762. package/docs/models/shared/addexpirationchangecreditledgerentryrequestparamsmetadata.md +9 -0
  763. package/docs/models/shared/addincrementcreditledgerentryrequestparams.md +15 -0
  764. package/docs/models/shared/addincrementcreditledgerentryrequestparamsentrytype.md +8 -0
  765. package/docs/models/shared/addincrementcreditledgerentryrequestparamsmetadata.md +9 -0
  766. package/docs/models/shared/addpriceintervalparams.md +16 -0
  767. package/docs/models/shared/addpriceintervalparamsenddateenddate.md +11 -0
  768. package/docs/models/shared/addpriceintervalparamsstartdatestartdate.md +11 -0
  769. package/docs/models/shared/address.md +13 -0
  770. package/docs/models/shared/addressinput.md +13 -0
  771. package/docs/models/shared/addvoidcreditledgerentryrequestparams.md +13 -0
  772. package/docs/models/shared/addvoidcreditledgerentryrequestparamsentrytype.md +8 -0
  773. package/docs/models/shared/addvoidcreditledgerentryrequestparamsmetadata.md +9 -0
  774. package/docs/models/shared/addvoidcreditledgerentryrequestparamsvoidreason.md +10 -0
  775. package/docs/models/shared/affectedblock.md +10 -0
  776. package/docs/models/shared/aggregatedcost.md +12 -0
  777. package/docs/models/shared/amendedevent.md +12 -0
  778. package/docs/models/shared/amendedeventproperties.md +9 -0
  779. package/docs/models/shared/amendedusage.md +9 -0
  780. package/docs/models/shared/amendeventresult.md +8 -0
  781. package/docs/models/shared/amendmentledgerentry.md +21 -0
  782. package/docs/models/shared/amendmentledgerentryentrystatus.md +9 -0
  783. package/docs/models/shared/amendmentledgerentryentrytype.md +8 -0
  784. package/docs/models/shared/amountdiscount.md +10 -0
  785. package/docs/models/shared/amountdiscountcreationparams.md +9 -0
  786. package/docs/models/shared/amountdiscountcreationparamsdiscounttype.md +8 -0
  787. package/docs/models/shared/amountdiscountdiscounttype.md +8 -0
  788. package/docs/models/shared/amountdiscountinterval.md +13 -0
  789. package/docs/models/shared/amountdiscountintervaldiscounttype.md +8 -0
  790. package/docs/models/shared/autocollection.md +10 -0
  791. package/docs/models/shared/backfill.md +17 -0
  792. package/docs/models/shared/backfills.md +9 -0
  793. package/docs/models/shared/backfillstatus.md +13 -0
  794. package/docs/models/shared/billablemetric.md +16 -0
  795. package/docs/models/shared/billablemetrics.md +9 -0
  796. package/docs/models/shared/billablemetricsimple.md +9 -0
  797. package/docs/models/shared/billablemetricstatus.md +10 -0
  798. package/docs/models/shared/billablemetrictiny.md +8 -0
  799. package/docs/models/shared/billingcyclealignment.md +12 -0
  800. package/docs/models/shared/bpsconfig.md +9 -0
  801. package/docs/models/shared/bpsprice.md +225 -0
  802. package/docs/models/shared/bpspricecadence.md +11 -0
  803. package/docs/models/shared/bpspricemodeltype.md +8 -0
  804. package/docs/models/shared/bpspricepricetype.md +9 -0
  805. package/docs/models/shared/bpstier.md +11 -0
  806. package/docs/models/shared/bulkbpsconfig.md +8 -0
  807. package/docs/models/shared/bulkbpsprice.md +225 -0
  808. package/docs/models/shared/bulkbpspricecadence.md +11 -0
  809. package/docs/models/shared/bulkbpspricemodeltype.md +8 -0
  810. package/docs/models/shared/bulkbpspricepricetype.md +9 -0
  811. package/docs/models/shared/bulkbpstier.md +10 -0
  812. package/docs/models/shared/bulkconfig.md +8 -0
  813. package/docs/models/shared/bulkprice.md +225 -0
  814. package/docs/models/shared/bulkpricecadence.md +11 -0
  815. package/docs/models/shared/bulkpricemodeltype.md +8 -0
  816. package/docs/models/shared/bulkpricepricetype.md +9 -0
  817. package/docs/models/shared/bulktier.md +9 -0
  818. package/docs/models/shared/cancelsubscriptionparams.md +9 -0
  819. package/docs/models/shared/cancelsubscriptionparamscanceloption.md +12 -0
  820. package/docs/models/shared/changeoption.md +10 -0
  821. package/docs/models/shared/coupon.md +21 -0
  822. package/docs/models/shared/coupondiscount.md +7 -0
  823. package/docs/models/shared/couponredemption.md +10 -0
  824. package/docs/models/shared/coupons.md +9 -0
  825. package/docs/models/shared/createinvoicelineitemparams.md +13 -0
  826. package/docs/models/shared/createoneoffinvoiceparams.md +15 -0
  827. package/docs/models/shared/creditblockexpiryledgerentry.md +21 -0
  828. package/docs/models/shared/creditblockexpiryledgerentryentrystatus.md +9 -0
  829. package/docs/models/shared/creditblockexpiryledgerentryentrytype.md +8 -0
  830. package/docs/models/shared/creditledgerentries.md +9 -0
  831. package/docs/models/shared/creditnote.md +26 -0
  832. package/docs/models/shared/creditnotediscounts.md +7 -0
  833. package/docs/models/shared/creditnotelineitem.md +15 -0
  834. package/docs/models/shared/creditnotelineitemdiscounts.md +7 -0
  835. package/docs/models/shared/creditnotelineitemtaxamounts.md +7 -0
  836. package/docs/models/shared/creditnotemaximumamountadjustment.md +9 -0
  837. package/docs/models/shared/creditnoteminified.md +8 -0
  838. package/docs/models/shared/creditnotereason.md +11 -0
  839. package/docs/models/shared/creditnotes.md +9 -0
  840. package/docs/models/shared/creditnotesublineitem.md +10 -0
  841. package/docs/models/shared/creditnotesummary.md +13 -0
  842. package/docs/models/shared/creditnotetype.md +9 -0
  843. package/docs/models/shared/customer.md +42 -0
  844. package/docs/models/shared/customerbalancetransaction.md +17 -0
  845. package/docs/models/shared/customerbalancetransactionaction.md +10 -0
  846. package/docs/models/shared/customerbalancetransactions.md +9 -0
  847. package/docs/models/shared/customerbalancetransactiontype.md +9 -0
  848. package/docs/models/shared/customercosts.md +8 -0
  849. package/docs/models/shared/customercreditbalance.md +11 -0
  850. package/docs/models/shared/customercreditbalances.md +9 -0
  851. package/docs/models/shared/customerminified.md +9 -0
  852. package/docs/models/shared/customerpaymentprovider.md +14 -0
  853. package/docs/models/shared/customers.md +9 -0
  854. package/docs/models/shared/customertaxid.md +10 -0
  855. package/docs/models/shared/debug.md +11 -0
  856. package/docs/models/shared/decrementledgerentry.md +24 -0
  857. package/docs/models/shared/decrementledgerentryentrystatus.md +9 -0
  858. package/docs/models/shared/decrementledgerentryentrytype.md +8 -0
  859. package/docs/models/shared/deletecustomerresponse.md +7 -0
  860. package/docs/models/shared/deprecatedeventresult.md +8 -0
  861. package/docs/models/shared/discount.md +15 -0
  862. package/docs/models/shared/discountdiscounttype.md +11 -0
  863. package/docs/models/shared/duplicateconstraintviolationerror.md +12 -0
  864. package/docs/models/shared/duplicateconstraintviolationerrorheaders.md +7 -0
  865. package/docs/models/shared/duplicateconstraintviolationerrorstatus.md +8 -0
  866. package/docs/models/shared/duplicateconstraintviolationerrortype.md +8 -0
  867. package/docs/models/shared/duplicateresourcecreationerror.md +12 -0
  868. package/docs/models/shared/duplicateresourcecreationerrorheaders.md +7 -0
  869. package/docs/models/shared/duplicateresourcecreationerrorstatus.md +8 -0
  870. package/docs/models/shared/duplicateresourcecreationerrortype.md +8 -0
  871. package/docs/models/shared/editcustomer.md +22 -0
  872. package/docs/models/shared/editcustomermetadata.md +9 -0
  873. package/docs/models/shared/editcustomerpaymentprovider.md +16 -0
  874. package/docs/models/shared/editplan.md +9 -0
  875. package/docs/models/shared/editplanmetadata.md +7 -0
  876. package/docs/models/shared/editpriceintervalparams.md +11 -0
  877. package/docs/models/shared/editpriceintervalparamsenddateenddate.md +11 -0
  878. package/docs/models/shared/editpriceintervalparamsstartdatestartdate.md +11 -0
  879. package/docs/models/shared/event.md +17 -0
  880. package/docs/models/shared/eventproperties.md +9 -0
  881. package/docs/models/shared/events.md +9 -0
  882. package/docs/models/shared/eventsearchcriteria.md +9 -0
  883. package/docs/models/shared/expirationchangeledgerentry.md +22 -0
  884. package/docs/models/shared/expirationchangeledgerentryentrystatus.md +9 -0
  885. package/docs/models/shared/expirationchangeledgerentryentrytype.md +8 -0
  886. package/docs/models/shared/featurenotavailableerror.md +12 -0
  887. package/docs/models/shared/featurenotavailableerrorheaders.md +7 -0
  888. package/docs/models/shared/featurenotavailableerrorstatus.md +8 -0
  889. package/docs/models/shared/featurenotavailableerrortype.md +8 -0
  890. package/docs/models/shared/fivehundrederror.md +12 -0
  891. package/docs/models/shared/fivehundrederrorheaders.md +7 -0
  892. package/docs/models/shared/fivehundrederrortype.md +8 -0
  893. package/docs/models/shared/fivetranexampleprice.md +225 -0
  894. package/docs/models/shared/fivetranexamplepricecadence.md +11 -0
  895. package/docs/models/shared/fivetranexamplepricemodeltype.md +8 -0
  896. package/docs/models/shared/fivetranexamplepricepricetype.md +9 -0
  897. package/docs/models/shared/fixedfeequantitychange.md +11 -0
  898. package/docs/models/shared/fixedfeequantitychangechangeoption.md +12 -0
  899. package/docs/models/shared/fixedfeequantityscheduleentry.md +11 -0
  900. package/docs/models/shared/fixedfeequantitytransition.md +10 -0
  901. package/docs/models/shared/fourhundredandoneerror.md +12 -0
  902. package/docs/models/shared/fourhundredandoneerrorheaders.md +7 -0
  903. package/docs/models/shared/fourhundredandoneerrorstatus.md +8 -0
  904. package/docs/models/shared/fourhundredandoneerrortype.md +8 -0
  905. package/docs/models/shared/fourhundredandtwentynineerror.md +12 -0
  906. package/docs/models/shared/fourhundredandtwentynineerrorheaders.md +7 -0
  907. package/docs/models/shared/fourhundredandtwentynineerrorstatus.md +8 -0
  908. package/docs/models/shared/fourhundredandtwentynineerrortype.md +8 -0
  909. package/docs/models/shared/groupedsubscriptionusage.md +9 -0
  910. package/docs/models/shared/groupedsubscriptionusagerecord.md +11 -0
  911. package/docs/models/shared/groupedsubscriptionusagerecordviewmode.md +9 -0
  912. package/docs/models/shared/idempotencyconflict.md +12 -0
  913. package/docs/models/shared/idempotencyconflictheaders.md +7 -0
  914. package/docs/models/shared/idempotencyconflictstatus.md +8 -0
  915. package/docs/models/shared/idempotencyconflicttype.md +8 -0
  916. package/docs/models/shared/idempotencykeyvalidationerror.md +13 -0
  917. package/docs/models/shared/idempotencykeyvalidationerrorheaders.md +7 -0
  918. package/docs/models/shared/idempotencykeyvalidationerrorstatus.md +8 -0
  919. package/docs/models/shared/idempotencykeyvalidationerrortype.md +8 -0
  920. package/docs/models/shared/idempotencyrequestmismatch.md +12 -0
  921. package/docs/models/shared/idempotencyrequestmismatchheaders.md +7 -0
  922. package/docs/models/shared/idempotencyrequestmismatchstatus.md +8 -0
  923. package/docs/models/shared/idempotencyrequestmismatchtype.md +8 -0
  924. package/docs/models/shared/incrementcreditledgerentryinvoicesettings.md +12 -0
  925. package/docs/models/shared/incrementledgerentry.md +21 -0
  926. package/docs/models/shared/incrementledgerentryentrystatus.md +9 -0
  927. package/docs/models/shared/incrementledgerentryentrytype.md +8 -0
  928. package/docs/models/shared/ingestevent.md +13 -0
  929. package/docs/models/shared/ingesteventproperties.md +9 -0
  930. package/docs/models/shared/ingestionresponse.md +9 -0
  931. package/docs/models/shared/ingestrequestbody.md +8 -0
  932. package/docs/models/shared/invoice.md +51 -0
  933. package/docs/models/shared/invoicelineitem.md +23 -0
  934. package/docs/models/shared/invoicelineitemparams.md +14 -0
  935. package/docs/models/shared/invoicelineitemparamsmodeltype.md +8 -0
  936. package/docs/models/shared/invoicemetadata.md +7 -0
  937. package/docs/models/shared/invoiceminified.md +8 -0
  938. package/docs/models/shared/invoices.md +9 -0
  939. package/docs/models/shared/invoicestatus.md +12 -0
  940. package/docs/models/shared/item.md +14 -0
  941. package/docs/models/shared/itemexternalconnection.md +9 -0
  942. package/docs/models/shared/itemexternalconnectionexternalconnectionnameexternalconnectionname.md +11 -0
  943. package/docs/models/shared/itemexternalconnectionexternalconnectionnameexternalconnectionname1.md +10 -0
  944. package/docs/models/shared/items.md +9 -0
  945. package/docs/models/shared/itemslim.md +9 -0
  946. package/docs/models/shared/markaspaidrequestparams.md +10 -0
  947. package/docs/models/shared/matrixconfig.md +11 -0
  948. package/docs/models/shared/matrixprice.md +225 -0
  949. package/docs/models/shared/matrixpricecadence.md +11 -0
  950. package/docs/models/shared/matrixpricemodeltype.md +8 -0
  951. package/docs/models/shared/matrixpricepricetype.md +9 -0
  952. package/docs/models/shared/matrixsublineitem.md +13 -0
  953. package/docs/models/shared/matrixsublineitemtype.md +8 -0
  954. package/docs/models/shared/matrixvalue.md +10 -0
  955. package/docs/models/shared/maximum.md +9 -0
  956. package/docs/models/shared/maximuminterval.md +12 -0
  957. package/docs/models/shared/metricgroup.md +9 -0
  958. package/docs/models/shared/minimum.md +9 -0
  959. package/docs/models/shared/minimuminterval.md +12 -0
  960. package/docs/models/shared/newaccountingsyncconfiguration.md +9 -0
  961. package/docs/models/shared/newbackfill.md +13 -0
  962. package/docs/models/shared/newbillablemetric.md +12 -0
  963. package/docs/models/shared/newbillablemetricmetadata.md +9 -0
  964. package/docs/models/shared/newbpsprice.md +18 -0
  965. package/docs/models/shared/newbpspricecadence.md +12 -0
  966. package/docs/models/shared/newbpspricemodeltype.md +8 -0
  967. package/docs/models/shared/newbulkbpsprice.md +18 -0
  968. package/docs/models/shared/newbulkbpspricecadence.md +12 -0
  969. package/docs/models/shared/newbulkbpspricemodeltype.md +8 -0
  970. package/docs/models/shared/newbulkprice.md +18 -0
  971. package/docs/models/shared/newbulkpricecadence.md +12 -0
  972. package/docs/models/shared/newbulkpricemodeltype.md +8 -0
  973. package/docs/models/shared/newcoupon.md +11 -0
  974. package/docs/models/shared/newcoupondiscount.md +7 -0
  975. package/docs/models/shared/newcustomer.md +23 -0
  976. package/docs/models/shared/newcustomerbalancetransaction.md +10 -0
  977. package/docs/models/shared/newcustomerbalancetransactiontype.md +9 -0
  978. package/docs/models/shared/newcustomermetadata.md +9 -0
  979. package/docs/models/shared/newcustomerpaymentprovider.md +14 -0
  980. package/docs/models/shared/newmatrixprice.md +18 -0
  981. package/docs/models/shared/newmatrixpricecadence.md +12 -0
  982. package/docs/models/shared/newmatrixpricemodeltype.md +8 -0
  983. package/docs/models/shared/newpackageprice.md +18 -0
  984. package/docs/models/shared/newpackagepricecadence.md +12 -0
  985. package/docs/models/shared/newpackagepricemodeltype.md +8 -0
  986. package/docs/models/shared/newpackagewithallocationprice.md +18 -0
  987. package/docs/models/shared/newpackagewithallocationpricecadence.md +12 -0
  988. package/docs/models/shared/newpackagewithallocationpricemodeltype.md +8 -0
  989. package/docs/models/shared/newplan.md +14 -0
  990. package/docs/models/shared/newplanmetadata.md +7 -0
  991. package/docs/models/shared/newplanprices.md +7 -0
  992. package/docs/models/shared/newreportingconfiguration.md +8 -0
  993. package/docs/models/shared/newsubscription.md +31 -0
  994. package/docs/models/shared/newsubscriptionexternalmarketplace.md +10 -0
  995. package/docs/models/shared/newsubscriptionmetadata.md +7 -0
  996. package/docs/models/shared/newthresholdtotalamountprice.md +18 -0
  997. package/docs/models/shared/newthresholdtotalamountpricecadence.md +12 -0
  998. package/docs/models/shared/newthresholdtotalamountpricemodeltype.md +8 -0
  999. package/docs/models/shared/newtieredbpsprice.md +18 -0
  1000. package/docs/models/shared/newtieredbpspricecadence.md +12 -0
  1001. package/docs/models/shared/newtieredbpspricemodeltype.md +8 -0
  1002. package/docs/models/shared/newtieredpackageprice.md +18 -0
  1003. package/docs/models/shared/newtieredpackagepricecadence.md +12 -0
  1004. package/docs/models/shared/newtieredpackagepricemodeltype.md +8 -0
  1005. package/docs/models/shared/newtieredprice.md +18 -0
  1006. package/docs/models/shared/newtieredpricecadence.md +12 -0
  1007. package/docs/models/shared/newtieredpricemodeltype.md +8 -0
  1008. package/docs/models/shared/newtieredwithminimumprice.md +18 -0
  1009. package/docs/models/shared/newtieredwithminimumpricecadence.md +12 -0
  1010. package/docs/models/shared/newtieredwithminimumpricemodeltype.md +8 -0
  1011. package/docs/models/shared/newunitprice.md +18 -0
  1012. package/docs/models/shared/newunitpricecadence.md +12 -0
  1013. package/docs/models/shared/newunitpricemodeltype.md +8 -0
  1014. package/docs/models/shared/othersublineitem.md +12 -0
  1015. package/docs/models/shared/othersublineitemtype.md +8 -0
  1016. package/docs/models/shared/overridebpsprice.md +14 -0
  1017. package/docs/models/shared/overridebpspricemodeltype.md +8 -0
  1018. package/docs/models/shared/overridebulkbpsprice.md +14 -0
  1019. package/docs/models/shared/overridebulkbpspricemodeltype.md +8 -0
  1020. package/docs/models/shared/overridebulkprice.md +14 -0
  1021. package/docs/models/shared/overridebulkpricemodeltype.md +8 -0
  1022. package/docs/models/shared/overridefivetranexampleprice.md +14 -0
  1023. package/docs/models/shared/overridefivetranexamplepricemodeltype.md +8 -0
  1024. package/docs/models/shared/overridematrixprice.md +14 -0
  1025. package/docs/models/shared/overridematrixpricemodeltype.md +8 -0
  1026. package/docs/models/shared/overridepackageprice.md +14 -0
  1027. package/docs/models/shared/overridepackagepricemodeltype.md +8 -0
  1028. package/docs/models/shared/overridepackagewithallocationprice.md +14 -0
  1029. package/docs/models/shared/overridepackagewithallocationpricemodeltype.md +8 -0
  1030. package/docs/models/shared/overridetestratingfunctionprice.md +14 -0
  1031. package/docs/models/shared/overridetestratingfunctionpricemodeltype.md +8 -0
  1032. package/docs/models/shared/overridethresholdtotalamountprice.md +14 -0
  1033. package/docs/models/shared/overridethresholdtotalamountpricemodeltype.md +8 -0
  1034. package/docs/models/shared/overridetieredbpsprice.md +14 -0
  1035. package/docs/models/shared/overridetieredbpspricemodeltype.md +8 -0
  1036. package/docs/models/shared/overridetieredpackageprice.md +14 -0
  1037. package/docs/models/shared/overridetieredpackagepricemodeltype.md +8 -0
  1038. package/docs/models/shared/overridetieredprice.md +14 -0
  1039. package/docs/models/shared/overridetieredpricemodeltype.md +8 -0
  1040. package/docs/models/shared/overridetieredwithminimumprice.md +14 -0
  1041. package/docs/models/shared/overridetieredwithminimumpricemodeltype.md +8 -0
  1042. package/docs/models/shared/overrideunitprice.md +14 -0
  1043. package/docs/models/shared/overrideunitpricemodeltype.md +8 -0
  1044. package/docs/models/shared/packageconfig.md +9 -0
  1045. package/docs/models/shared/packageprice.md +225 -0
  1046. package/docs/models/shared/packagepricecadence.md +11 -0
  1047. package/docs/models/shared/packagepricemodeltype.md +8 -0
  1048. package/docs/models/shared/packagepricepricetype.md +9 -0
  1049. package/docs/models/shared/packagewithallocationprice.md +225 -0
  1050. package/docs/models/shared/packagewithallocationpricecadence.md +11 -0
  1051. package/docs/models/shared/packagewithallocationpricemodeltype.md +8 -0
  1052. package/docs/models/shared/packagewithallocationpricepricetype.md +9 -0
  1053. package/docs/models/shared/paginationmetadata.md +9 -0
  1054. package/docs/models/shared/percentagediscount.md +10 -0
  1055. package/docs/models/shared/percentagediscountcreationparams.md +9 -0
  1056. package/docs/models/shared/percentagediscountcreationparamsdiscounttype.md +8 -0
  1057. package/docs/models/shared/percentagediscountdiscounttype.md +8 -0
  1058. package/docs/models/shared/percentagediscountinterval.md +13 -0
  1059. package/docs/models/shared/percentagediscountintervaldiscounttype.md +8 -0
  1060. package/docs/models/shared/perpricecost.md +12 -0
  1061. package/docs/models/shared/phaseoverride.md +11 -0
  1062. package/docs/models/shared/pingresponse.md +8 -0
  1063. package/docs/models/shared/plan.md +33 -0
  1064. package/docs/models/shared/planmetadata.md +7 -0
  1065. package/docs/models/shared/planminified.md +10 -0
  1066. package/docs/models/shared/planphase.md +18 -0
  1067. package/docs/models/shared/planphasedurationunit.md +11 -0
  1068. package/docs/models/shared/planprices.md +7 -0
  1069. package/docs/models/shared/plans.md +9 -0
  1070. package/docs/models/shared/planstatus.md +10 -0
  1071. package/docs/models/shared/pricegroup.md +12 -0
  1072. package/docs/models/shared/priceinterval.md +18 -0
  1073. package/docs/models/shared/priceintervalfixedfeequantitytransitionparams.md +9 -0
  1074. package/docs/models/shared/prices.md +9 -0
  1075. package/docs/models/shared/product.md +10 -0
  1076. package/docs/models/shared/reportingconfiguration.md +8 -0
  1077. package/docs/models/shared/requesttoolargeerror.md +12 -0
  1078. package/docs/models/shared/requesttoolargeerrorheaders.md +7 -0
  1079. package/docs/models/shared/requesttoolargeerrorstatus.md +8 -0
  1080. package/docs/models/shared/requesttoolargeerrortype.md +8 -0
  1081. package/docs/models/shared/requestvalidationerror.md +13 -0
  1082. package/docs/models/shared/requestvalidationerrorheaders.md +7 -0
  1083. package/docs/models/shared/requestvalidationerrorstatus.md +8 -0
  1084. package/docs/models/shared/requestvalidationerrortype.md +8 -0
  1085. package/docs/models/shared/resourcenotfounderror.md +12 -0
  1086. package/docs/models/shared/resourcenotfounderrorheaders.md +7 -0
  1087. package/docs/models/shared/resourcenotfounderrorstatus.md +8 -0
  1088. package/docs/models/shared/resourcenotfounderrortype.md +8 -0
  1089. package/docs/models/shared/resourcetoolargeerror.md +12 -0
  1090. package/docs/models/shared/resourcetoolargeerrorheaders.md +7 -0
  1091. package/docs/models/shared/resourcetoolargeerrorstatus.md +8 -0
  1092. package/docs/models/shared/resourcetoolargeerrortype.md +8 -0
  1093. package/docs/models/shared/security.md +8 -0
  1094. package/docs/models/shared/sublineitemgrouping.md +9 -0
  1095. package/docs/models/shared/sublineitemmatrixconfig.md +8 -0
  1096. package/docs/models/shared/subscription.md +44 -0
  1097. package/docs/models/shared/subscriptioncosts.md +8 -0
  1098. package/docs/models/shared/subscriptionmetadata.md +9 -0
  1099. package/docs/models/shared/subscriptionminified.md +8 -0
  1100. package/docs/models/shared/subscriptionplanchange.md +23 -0
  1101. package/docs/models/shared/subscriptions.md +9 -0
  1102. package/docs/models/shared/subscriptionscheduleitem.md +10 -0
  1103. package/docs/models/shared/subscriptionscheduleitems.md +9 -0
  1104. package/docs/models/shared/subscriptionstatus.md +10 -0
  1105. package/docs/models/shared/subscriptiontrialinfo.md +8 -0
  1106. package/docs/models/shared/taxamount.md +10 -0
  1107. package/docs/models/shared/testratingfunctionprice.md +225 -0
  1108. package/docs/models/shared/testratingfunctionpricecadence.md +11 -0
  1109. package/docs/models/shared/testratingfunctionpricemodeltype.md +8 -0
  1110. package/docs/models/shared/testratingfunctionpricepricetype.md +9 -0
  1111. package/docs/models/shared/thresholdtotalamountprice.md +225 -0
  1112. package/docs/models/shared/thresholdtotalamountpricecadence.md +11 -0
  1113. package/docs/models/shared/thresholdtotalamountpricemodeltype.md +8 -0
  1114. package/docs/models/shared/thresholdtotalamountpricepricetype.md +9 -0
  1115. package/docs/models/shared/tier.md +10 -0
  1116. package/docs/models/shared/tierconfig.md +10 -0
  1117. package/docs/models/shared/tieredbpsconfig.md +8 -0
  1118. package/docs/models/shared/tieredbpsprice.md +225 -0
  1119. package/docs/models/shared/tieredbpspricecadence.md +11 -0
  1120. package/docs/models/shared/tieredbpspricemodeltype.md +8 -0
  1121. package/docs/models/shared/tieredbpspricepricetype.md +9 -0
  1122. package/docs/models/shared/tieredconfig.md +8 -0
  1123. package/docs/models/shared/tieredpackageprice.md +225 -0
  1124. package/docs/models/shared/tieredpackagepricecadence.md +11 -0
  1125. package/docs/models/shared/tieredpackagepricemodeltype.md +8 -0
  1126. package/docs/models/shared/tieredpackagepricepricetype.md +9 -0
  1127. package/docs/models/shared/tieredprice.md +225 -0
  1128. package/docs/models/shared/tieredpricecadence.md +11 -0
  1129. package/docs/models/shared/tieredpricemodeltype.md +8 -0
  1130. package/docs/models/shared/tieredpricepricetype.md +9 -0
  1131. package/docs/models/shared/tieredwithminimumprice.md +225 -0
  1132. package/docs/models/shared/tieredwithminimumpricecadence.md +11 -0
  1133. package/docs/models/shared/tieredwithminimumpricemodeltype.md +8 -0
  1134. package/docs/models/shared/tieredwithminimumpricepricetype.md +9 -0
  1135. package/docs/models/shared/tiersublineitem.md +13 -0
  1136. package/docs/models/shared/tiersublineitemtype.md +8 -0
  1137. package/docs/models/shared/trialconfig.md +9 -0
  1138. package/docs/models/shared/trialconfigtrialperiodunit.md +8 -0
  1139. package/docs/models/shared/trialdiscount.md +11 -0
  1140. package/docs/models/shared/trialdiscountdiscounttype.md +8 -0
  1141. package/docs/models/shared/triggersubscriptionphaseparams.md +8 -0
  1142. package/docs/models/shared/ungroupedsubscriptionusage.md +8 -0
  1143. package/docs/models/shared/ungroupedsubscriptionusagerecord.md +10 -0
  1144. package/docs/models/shared/ungroupedsubscriptionusagerecordviewmode.md +9 -0
  1145. package/docs/models/shared/unitconfig.md +9 -0
  1146. package/docs/models/shared/unitprice.md +225 -0
  1147. package/docs/models/shared/unitpricecadence.md +11 -0
  1148. package/docs/models/shared/unitpricemodeltype.md +8 -0
  1149. package/docs/models/shared/unitpricepricetype.md +9 -0
  1150. package/docs/models/shared/unschedulefixedfeequantitychangeparams.md +8 -0
  1151. package/docs/models/shared/upcominginvoice.md +46 -0
  1152. package/docs/models/shared/upcominginvoicemetadata.md +7 -0
  1153. package/docs/models/shared/upcominginvoicestatus.md +12 -0
  1154. package/docs/models/shared/updateevent.md +12 -0
  1155. package/docs/models/shared/updateeventproperties.md +9 -0
  1156. package/docs/models/shared/urlnotfound.md +12 -0
  1157. package/docs/models/shared/urlnotfoundheaders.md +7 -0
  1158. package/docs/models/shared/urlnotfoundstatus.md +8 -0
  1159. package/docs/models/shared/urlnotfoundtype.md +8 -0
  1160. package/docs/models/shared/usage.md +10 -0
  1161. package/docs/models/shared/usagediscount.md +10 -0
  1162. package/docs/models/shared/usagediscountcreationparams.md +9 -0
  1163. package/docs/models/shared/usagediscountcreationparamsdiscounttype.md +8 -0
  1164. package/docs/models/shared/usagediscountdiscounttype.md +8 -0
  1165. package/docs/models/shared/usagediscountinterval.md +13 -0
  1166. package/docs/models/shared/usagediscountintervaldiscounttype.md +8 -0
  1167. package/docs/models/shared/validationerror.md +9 -0
  1168. package/docs/models/shared/voidinitiatedledgerentry.md +24 -0
  1169. package/docs/models/shared/voidinitiatedledgerentryentrystatus.md +9 -0
  1170. package/docs/models/shared/voidinitiatedledgerentryentrytype.md +8 -0
  1171. package/docs/models/shared/voidledgerentry.md +23 -0
  1172. package/docs/models/shared/voidledgerentryentrystatus.md +9 -0
  1173. package/docs/models/shared/voidledgerentryentrytype.md +8 -0
  1174. package/docs/sdks/availability/README.md +45 -0
  1175. package/docs/sdks/coupon/README.md +226 -0
  1176. package/docs/sdks/credit/README.md +605 -0
  1177. package/docs/sdks/creditnote/README.md +91 -0
  1178. package/docs/sdks/customer/README.md +1129 -0
  1179. package/docs/sdks/event/README.md +674 -0
  1180. package/docs/sdks/invoice/README.md +402 -0
  1181. package/docs/sdks/item/README.md +89 -0
  1182. package/docs/sdks/metric/README.md +140 -0
  1183. package/docs/sdks/orb/README.md +21 -0
  1184. package/docs/sdks/plan/README.md +300 -0
  1185. package/docs/sdks/price/README.md +411 -0
  1186. package/docs/sdks/priceinterval/README.md +180 -0
  1187. package/docs/sdks/subscription/README.md +1412 -0
  1188. package/docs/types/rfcdate.md +11 -0
  1189. package/package.json +2 -1
  1190. package/dist/sdk/models/operations/addledgerentryexternalid.d.ts +0 -16
  1191. package/dist/sdk/models/operations/listcreditnote.d.ts +0 -34
  1192. package/dist/sdk/models/shared/action.d.ts +0 -8
  1193. package/dist/sdk/models/shared/action.js +0 -15
  1194. package/dist/sdk/models/shared/billablemetricminified.d.ts +0 -5
  1195. package/dist/sdk/models/shared/bpspriceoverride.d.ts +0 -24
  1196. package/dist/sdk/models/shared/bulkbpspriceoverride.d.ts +0 -24
  1197. package/dist/sdk/models/shared/bulkpriceoverride.d.ts +0 -24
  1198. package/dist/sdk/models/shared/cadence.d.ts +0 -5
  1199. package/dist/sdk/models/shared/cadence.js +0 -12
  1200. package/dist/sdk/models/shared/canceloption.d.ts +0 -8
  1201. package/dist/sdk/models/shared/canceloption.js +0 -15
  1202. package/dist/sdk/models/shared/changeoption1.d.ts +0 -8
  1203. package/dist/sdk/models/shared/changeoption1.js +0 -15
  1204. package/dist/sdk/models/shared/credit.d.ts +0 -16
  1205. package/dist/sdk/models/shared/creditblock.d.ts +0 -15
  1206. package/dist/sdk/models/shared/creditledgerentry.d.ts +0 -58
  1207. package/dist/sdk/models/shared/creditnotetype.d.ts +0 -7
  1208. package/dist/sdk/models/shared/creditnotetype.js +0 -14
  1209. package/dist/sdk/models/shared/customercost.d.ts +0 -15
  1210. package/dist/sdk/models/shared/discounttype.d.ts +0 -6
  1211. package/dist/sdk/models/shared/discounttype.js +0 -13
  1212. package/dist/sdk/models/shared/durationunit.d.ts +0 -8
  1213. package/dist/sdk/models/shared/durationunit.js +0 -15
  1214. package/dist/sdk/models/shared/entrystatus.d.ts +0 -7
  1215. package/dist/sdk/models/shared/entrystatus.js +0 -14
  1216. package/dist/sdk/models/shared/entrytype.d.ts +0 -9
  1217. package/dist/sdk/models/shared/entrytype.js +0 -16
  1218. package/dist/sdk/models/shared/eventsearchresults.d.ts +0 -10
  1219. package/dist/sdk/models/shared/externalmarketplace.d.ts +0 -8
  1220. package/dist/sdk/models/shared/externalmarketplace.js +0 -15
  1221. package/dist/sdk/models/shared/fixedfeequantityschedule.d.ts +0 -7
  1222. package/dist/sdk/models/shared/granularity.d.ts +0 -6
  1223. package/dist/sdk/models/shared/granularity.js +0 -13
  1224. package/dist/sdk/models/shared/grouping.d.ts +0 -8
  1225. package/dist/sdk/models/shared/invoicestatus.d.ts +0 -10
  1226. package/dist/sdk/models/shared/invoicestatus.js +0 -17
  1227. package/dist/sdk/models/shared/lineitem.d.ts +0 -58
  1228. package/dist/sdk/models/shared/lineitem.js +0 -147
  1229. package/dist/sdk/models/shared/matrixconfig1.d.ts +0 -10
  1230. package/dist/sdk/models/shared/modeltype.d.ts +0 -10
  1231. package/dist/sdk/models/shared/modeltype.js +0 -17
  1232. package/dist/sdk/models/shared/newcreditledgerentry.d.ts +0 -44
  1233. package/dist/sdk/models/shared/newtransaction.d.ts +0 -10
  1234. package/dist/sdk/models/shared/packagepriceoverride.d.ts +0 -24
  1235. package/dist/sdk/models/shared/price.d.ts +0 -114
  1236. package/dist/sdk/models/shared/price.js +0 -245
  1237. package/dist/sdk/models/shared/reason.d.ts +0 -9
  1238. package/dist/sdk/models/shared/reason.js +0 -16
  1239. package/dist/sdk/models/shared/sublineitem.d.ts +0 -32
  1240. package/dist/sdk/models/shared/sublineitem1.d.ts +0 -24
  1241. package/dist/sdk/models/shared/subscriptioncancellation.d.ts +0 -12
  1242. package/dist/sdk/models/shared/subscriptionstatus.d.ts +0 -5
  1243. package/dist/sdk/models/shared/subscriptionstatus.js +0 -12
  1244. package/dist/sdk/models/shared/subscriptionusage.d.ts +0 -8
  1245. package/dist/sdk/models/shared/tier7.d.ts +0 -7
  1246. package/dist/sdk/models/shared/tieredbpsconfig1.d.ts +0 -5
  1247. package/dist/sdk/models/shared/tieredbpspriceoverride.d.ts +0 -21
  1248. package/dist/sdk/models/shared/tieredpriceoverride.d.ts +0 -27
  1249. package/dist/sdk/models/shared/transactiontype.d.ts +0 -4
  1250. package/dist/sdk/models/shared/transactiontype.js +0 -11
  1251. package/dist/sdk/models/shared/type.d.ts +0 -7
  1252. package/dist/sdk/models/shared/type.js +0 -14
  1253. package/dist/sdk/models/shared/unitpriceoverride.d.ts +0 -24
  1254. package/dist/sdk/models/shared/usageitem.d.ts +0 -6
  1255. package/dist/sdk/models/shared/validationerrors.d.ts +0 -13
  1256. package/dist/sdk/models/shared/validationerrors.js +0 -59
  1257. package/dist/sdk/models/shared/viewmode.d.ts +0 -7
  1258. package/dist/sdk/models/shared/viewmode.js +0 -14
@@ -91,6 +91,7 @@ var __read = (this && this.__read) || function (o, n) {
91
91
  Object.defineProperty(exports, "__esModule", { value: true });
92
92
  exports.Subscription = void 0;
93
93
  var utils = __importStar(require("../internal/utils"));
94
+ var errors = __importStar(require("./models/errors"));
94
95
  var operations = __importStar(require("./models/operations"));
95
96
  var shared = __importStar(require("./models/shared"));
96
97
  /**
@@ -98,11 +99,17 @@ var shared = __importStar(require("./models/shared"));
98
99
  *
99
100
  * @remarks
100
101
  *
101
- * By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at the cadence that's configured in the plan definition.
102
+ * By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at
103
+ * the cadence that's configured in the plan definition.
102
104
  *
103
- * Subscriptions also default to **beginning of month alignment**, which means the first invoice issued for the subscription will have pro-rated charges between the `start_date` and the first of the following month. Subsequent billing periods will always start and end on a month boundary (e.g. subsequent month starts for monthly billing).
105
+ * Subscriptions also default to **beginning of month alignment**, which means the first invoice issued for the
106
+ * subscription will have pro-rated charges between the `start_date` and the first of the following month. Subsequent
107
+ * billing periods will always start and end on a month boundary (e.g. subsequent month starts for monthly billing).
104
108
  *
105
- * Depending on the plan configuration, any _flat_ recurring fees will be billed either at the beginning (in-advance) or end (in-arrears) of each billing cycle. Plans default to **in-advance billing**. Usage-based fees are billed in arrears as usage is accumulated. In the normal course of events, you can expect an invoice to contain usage-based charges for the previous period, and a recurring fee for the following period.
109
+ * Depending on the plan configuration, any _flat_ recurring fees will be billed either at the beginning (in-advance)
110
+ * or end (in-arrears) of each billing cycle. Plans default to **in-advance billing**. Usage-based fees are billed in
111
+ * arrears as usage is accumulated. In the normal course of events, you can expect an invoice to contain usage-based
112
+ * charges for the previous period, and a recurring fee for the following period.
106
113
  */
107
114
  var Subscription = /** @class */ (function () {
108
115
  function Subscription(sdkConfig) {
@@ -112,32 +119,54 @@ var Subscription = /** @class */ (function () {
112
119
  * Cancel subscription
113
120
  *
114
121
  * @remarks
115
- * This endpoint can be used to cancel an existing subscription. It returns the serialized subscription object with an `end_date` parameter that signifies when the subscription will transition to an ended state.
122
+ * This endpoint can be used to cancel an existing subscription. It returns the serialized subscription object with an
123
+ * `end_date` parameter that signifies when the subscription will transition to an ended state.
116
124
  *
117
125
  * The body parameter `cancel_option` determines the cancellation behavior. Orb supports three cancellation options:
118
- *
119
- * - `end_of_subscription_term`: stops the subscription from auto-renewing. Subscriptions that have been cancelled with this option can still incur charges for the remainder of their term:
120
- * - Issuing this cancellation request for a monthly subscription will keep the subscription active until the start of the subsequent month, and potentially issue an invoice for any usage charges incurred in the intervening period.
121
- * - Issuing this cancellation request for a quarterly subscription will keep the subscription active until the end of the quarter and potentially issue an invoice for any usage charges incurred in the intervening period.
122
- * - Issuing this cancellation request for a yearly subscription will keep the subscription active for the full year. For example, a yearly subscription starting on 2021-11-01 and cancelled on 2021-12-08 will remain active until 2022-11-01 and potentially issue charges in the intervening months for any recurring monthly usage charges in its plan.
123
- * - **Note**: If a subscription's plan contains prices with difference cadences, the end of term date will be determined by the largest cadence value. For example, cancelling end of term for a subscription with a quarterly fixed fee with a monthly usage fee will result in the subscription ending at the end of the quarter.
126
+ * - `end_of_subscription_term`: stops the subscription from auto-renewing. Subscriptions that have been cancelled with
127
+ * this option can still incur charges for the remainder of their term:
128
+ * - Issuing this cancellation request for a monthly subscription will keep the subscription active until the start
129
+ * of the subsequent month, and potentially issue an invoice for any usage charges incurred in the intervening
130
+ * period.
131
+ * - Issuing this cancellation request for a quarterly subscription will keep the subscription active until the end
132
+ * of the quarter and potentially issue an invoice for any usage charges incurred in the intervening period.
133
+ * - Issuing this cancellation request for a yearly subscription will keep the subscription active for the full
134
+ * year. For example, a yearly subscription starting on 2021-11-01 and cancelled on 2021-12-08 will remain active
135
+ * until 2022-11-01 and potentially issue charges in the intervening months for any recurring monthly usage
136
+ * charges in its plan.
137
+ * - **Note**: If a subscription's plan contains prices with difference cadences, the end of term date will be
138
+ * determined by the largest cadence value. For example, cancelling end of term for a subscription with a
139
+ * quarterly fixed fee with a monthly usage fee will result in the subscription ending at the end of the quarter.
124
140
  *
125
141
  * - `immediate`: ends the subscription immediately, setting the `end_date` to the current time:
126
- * - Subscriptions that have been cancelled with this option will be invoiced immediately. This invoice will include any usage fees incurred in the billing period up to the cancellation, along with any prorated recurring fees for the billing period, if applicable.
127
- * - **Note**: If the subscription has a recurring fee that was paid in-advance, the prorated amount for the remaining time period will be added to the [customer's balance](list-balance-transactions) upon immediate cancellation. However, if the customer is ineligible to use the customer balance, the subscription cannot be cancelled immediately.
128
- *
129
- * - `requested_date`: ends the subscription on a specified date, which requires a `cancellation_date` to be passed in. If no timezone is provided, the customer's timezone is used. For example, a subscription starting on January 1st with a monthly price can be set to be cancelled on the first of any month after January 1st (e.g. March 1st, April 1st, May 1st). A subscription with multiple prices with different cadences defines the "term" to be the highest cadence of the prices.
130
- *
131
- *
132
- * Upcoming subscriptions are only eligible for immediate cancellation, which will set the `end_date` equal to the `start_date` upon cancellation.
142
+ * - Subscriptions that have been cancelled with this option will be invoiced immediately. This invoice will
143
+ * include any usage fees incurred in the billing period up to the cancellation, along with any prorated
144
+ * recurring fees for the billing period, if applicable.
145
+ * - **Note**: If the subscription has a recurring fee that was paid in-advance, the prorated amount for the
146
+ * remaining time period will be added to the [customer's balance](list-balance-transactions) upon immediate
147
+ * cancellation. However, if the customer is ineligible to use the customer balance, the subscription cannot be
148
+ * cancelled immediately.
149
+ *
150
+ * - `requested_date`: ends the subscription on a specified date, which requires a `cancellation_date` to be passed in.
151
+ * If no timezone is provided, the customer's timezone is used. For example, a subscription starting on January 1st
152
+ * with a monthly price can be set to be cancelled on the first of any month after January 1st (e.g. March 1st, April
153
+ * 1st, May 1st). A subscription with multiple prices with different cadences defines the "term" to be the highest
154
+ * cadence of the prices.
155
+ *
156
+ * Upcoming subscriptions are only eligible for immediate cancellation, which will set the `end_date` equal to the
157
+ * `start_date` upon cancellation.
133
158
  *
134
159
  * ## Backdated cancellations
135
- * Orb allows you to cancel a subscription in the past as long as there are no paid invoices between the `requested_date` and the current time. If the cancellation is after the latest issued invoice, Orb will generate a balance refund for the current period. If the cancellation is before the most recently issued invoice, Orb will void the intervening invoice and generate a new one based on the new dates for the subscription. See the section on [cancellation behaviors](../guides/product-catalog/subscription-management.md#cancellation-behaviors).
160
+ * Orb allows you to cancel a subscription in the past as long as there are no paid invoices between the
161
+ * `requested_date` and the current time. If the cancellation is after the latest issued invoice, Orb will generate a
162
+ * balance refund for the current period. If the cancellation is before the most recently issued invoice, Orb will void
163
+ * the intervening invoice and generate a new one based on the new dates for the subscription. See the section on
164
+ * [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors).
136
165
  */
137
166
  Subscription.prototype.cancel = function (req, config) {
138
167
  var _a, _b;
139
168
  return __awaiter(this, void 0, void 0, function () {
140
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
169
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
141
170
  var _d;
142
171
  return __generator(this, function (_e) {
143
172
  switch (_e.label) {
@@ -147,21 +176,32 @@ var Subscription = /** @class */ (function () {
147
176
  }
148
177
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
149
178
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/cancel", req);
150
- _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
179
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
151
180
  try {
152
- _d = __read(utils.serializeRequestBody(req, "subscriptionCancellation", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
181
+ _d = __read(utils.serializeRequestBody(req, "cancelSubscriptionParams", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
153
182
  }
154
183
  catch (e) {
155
184
  if (e instanceof Error) {
156
185
  throw new Error("Error serializing request body, cause: ".concat(e.message));
157
186
  }
158
187
  }
159
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
160
- headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
188
+ client = this.sdkConfiguration.defaultClient;
189
+ globalSecurity = this.sdkConfiguration.security;
190
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
191
+ return [4 /*yield*/, globalSecurity()];
192
+ case 1:
193
+ globalSecurity = _e.sent();
194
+ _e.label = 2;
195
+ case 2:
196
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
197
+ globalSecurity = new shared.Security(globalSecurity);
198
+ }
199
+ properties = utils.parseSecurityProperties(globalSecurity);
200
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
161
201
  headers["Accept"] = "application/json";
162
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
202
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
163
203
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
164
- case 1:
204
+ case 3:
165
205
  httpRes = _e.sent();
166
206
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
167
207
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -178,6 +218,65 @@ var Subscription = /** @class */ (function () {
178
218
  if (utils.matchContentType(contentType, "application/json")) {
179
219
  res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
180
220
  }
221
+ else {
222
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
223
+ }
224
+ break;
225
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
226
+ if (utils.matchContentType(contentType, "application/json")) {
227
+ res.fourHundredError = JSON.parse(decodedRes);
228
+ }
229
+ else {
230
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
231
+ }
232
+ break;
233
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
234
+ if (utils.matchContentType(contentType, "application/json")) {
235
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
236
+ }
237
+ else {
238
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
239
+ }
240
+ break;
241
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
242
+ if (utils.matchContentType(contentType, "application/json")) {
243
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
244
+ }
245
+ else {
246
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
247
+ }
248
+ break;
249
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
250
+ if (utils.matchContentType(contentType, "application/json")) {
251
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
252
+ }
253
+ else {
254
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
255
+ }
256
+ break;
257
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
258
+ if (utils.matchContentType(contentType, "application/json")) {
259
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
260
+ }
261
+ else {
262
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
263
+ }
264
+ break;
265
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
266
+ if (utils.matchContentType(contentType, "application/json")) {
267
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
268
+ }
269
+ else {
270
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
271
+ }
272
+ break;
273
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
274
+ if (utils.matchContentType(contentType, "application/json")) {
275
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
276
+ }
277
+ else {
278
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
279
+ }
181
280
  break;
182
281
  }
183
282
  return [2 /*return*/, res];
@@ -189,28 +288,44 @@ var Subscription = /** @class */ (function () {
189
288
  * Create subscription
190
289
  *
191
290
  * @remarks
192
- * A subscription represents the purchase of a plan by a customer. The customer is identified by either the `customer_id` or the `external_customer_id`, and exactly one of these fields must be provided.
291
+ * A subscription represents the purchase of a plan by a customer. The customer is identified by either the `customer_id`
292
+ * or the `external_customer_id`, and exactly one of these fields must be provided.
193
293
  *
194
- * By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at the cadence that's configured in the plan definition.
294
+ * By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at the
295
+ * cadence that's configured in the plan definition.
195
296
  *
196
- * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning of month alignment** (see [Subscription](../guides/concepts#subscription) for more details).
297
+ * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning of month alignment** (see
298
+ * [Subscription](../guides/concepts#subscription) for more details).
197
299
  *
198
- * In order to change the alignment behavior, Orb also supports billing subscriptions on the day of the month they are created. If `align_billing_with_subscription_start_date = true` is specified, subscriptions have billing cycles that are aligned with their `start_date`. For example, a subscription that begins on January 15th will have a billing cycle from January 15th to February 15th. Every subsequent billing cycle will continue to start and invoice on the 15th.
300
+ * In order to change the alignment behavior, Orb also supports billing subscriptions on the day of the month they are
301
+ * created. If `align_billing_with_subscription_start_date = true` is specified, subscriptions have billing cycles that are
302
+ * aligned with their `start_date`. For example, a subscription that begins on January 15th will have a billing cycle from
303
+ * January 15th to February 15th. Every subsequent billing cycle will continue to start and invoice on the 15th.
199
304
  *
200
- * If the "day" value is greater than the number of days in the month, the next billing cycle will start at the end of the month. For example, if the start_date is January 31st, the next billing cycle will start on February 28th.
305
+ * If the "day" value is greater than the number of days in the month, the next billing cycle will start at the end of the
306
+ * month. For example, if the start_date is January 31st, the next billing cycle will start on February 28th.
201
307
  *
202
- * If a customer was created with a currency, Orb only allows subscribing the customer to a plan with a matching `invoicing_currency`. If the customer does not have a currency set, on subscription creation, we set the customer's currency to be the `invoicing_currency` of the plan.
308
+ * If a customer was created with a currency, Orb only allows subscribing the customer to a plan with a matching
309
+ * `invoicing_currency`. If the customer does not have a currency set, on subscription creation, we set the customer's
310
+ * currency to be the `invoicing_currency` of the plan.
203
311
  *
204
312
  * ## Price overrides
205
313
  *
206
- * Price overrides are used to update some or all prices in a plan for the specific subscription being created. This is useful when a new customer has negotiated one or more different prices for a specific plan than the plan's default prices. Any type of price can be overridden, if the correct data is provided. The billable metric, cadence, type, and name of a price can not be overridden.
314
+ * Price overrides are used to update some or all prices in a plan for the specific subscription being created. This is
315
+ * useful when a new customer has negotiated one or more different prices for a specific plan than the plan's default
316
+ * prices. Any type of price can be overridden, if the correct data is provided. The billable metric, cadence, type, and
317
+ * name of a price can not be overridden.
207
318
  *
208
319
  *
209
- * To override prices, provide a list of objects with the key `price_overrides`. The price object in the list of overrides is expected to contain the existing price id, the `model_type` and config value in the format below. The specific numerical values can be updated, but the config value and `model_type` must match the existing price that is being overridden
320
+ * To override prices, provide a list of objects with the key `price_overrides`. The price object in the list of overrides
321
+ * is expected to contain the existing price id, the `model_type` and config value in the format below. The specific
322
+ * numerical values can be updated, but the config value and `model_type` must match the existing price that is being
323
+ * overridden
210
324
  *
211
325
  * ### Request format for price overrides
212
326
  *
213
- * Orb supports a few different pricing models out of the box. The `model_type` field determines the key for the configuration object that is present.
327
+ * Orb supports a few different pricing models out of the box. The `model_type` field determines the key for the
328
+ * configuration object that is present.
214
329
  *
215
330
  * ### Unit pricing
216
331
  *
@@ -218,201 +333,230 @@ var Subscription = /** @class */ (function () {
218
333
  *
219
334
  * ```json
220
335
  * {
221
- * ...
222
- * "id": "price_id",
223
- * "model_type": "unit",
224
- * "unit_config": {
225
- * "unit_amount": "0.50"
226
- * }
227
- * ...
336
+ * ...
337
+ * "id": "price_id",
338
+ * "model_type": "unit",
339
+ * "unit_config": {
340
+ * "unit_amount": "0.50"
341
+ * }
342
+ * ...
228
343
  * }
229
344
  * ```
230
345
  *
231
346
  * ### Tiered pricing
232
347
  *
233
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first ten units may cost $0.50 each and all units thereafter may cost $0.10 each. Tiered prices can be overridden with a new number of tiers or new values for `first_unit`, `last_unit`, or `unit_amount`.
348
+ * In tiered pricing, the cost of a given unit depends on the tier range that it falls into, where each tier range is
349
+ * defined by an upper and lower bound. For example, the first ten units may cost $0.50 each and all units thereafter may
350
+ * cost $0.10 each. Tiered prices can be overridden with a new number of tiers or new values for `first_unit`, `last_unit`,
351
+ * or `unit_amount`.
234
352
  *
235
353
  * ```json
236
354
  * {
237
- * ...
238
- * "id": "price_id",
239
- * "model_type": "tiered",
240
- * "tiered_config": {
241
- * "tiers": [
242
- * {
243
- * "first_unit":"1",
244
- * "last_unit": "10",
245
- * "unit_amount": "0.50"
246
- * },
247
- * {
248
- * "first_unit": "10",
249
- * "last_unit": null,
250
- * "unit_amount": "0.10"
251
- * }
252
- * ]
253
- * }
254
- * ...
355
+ * ...
356
+ * "id": "price_id",
357
+ * "model_type": "tiered",
358
+ * "tiered_config": {
359
+ * "tiers": [
360
+ * {
361
+ * "first_unit":"1",
362
+ * "last_unit": "10",
363
+ * "unit_amount": "0.50"
364
+ * },
365
+ * {
366
+ * "first_unit": "10",
367
+ * "last_unit": null,
368
+ * "unit_amount": "0.10"
369
+ * }
370
+ * ]
371
+ * }
372
+ * ...
255
373
  * }
256
374
  * ```
257
375
  *
258
376
  * ### Bulk pricing
259
377
  *
260
- * Bulk pricing applies when the number of units determine the cost of _all_ units. For example, if you've bought less than 10 units, they may each be $0.50 for a total of $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e. 101 units total would be $40.40). Bulk prices can be overridden with a new number of tiers or new values for `maximum_units`, or `unit_amount`.
378
+ * Bulk pricing applies when the number of units determine the cost of _all_ units. For example, if you've bought less than
379
+ * 10 units, they may each be $0.50 for a total of $5.00. Once you've bought more than 10 units, all units may now be
380
+ * priced at $0.40 (i.e. 101 units total would be $40.40). Bulk prices can be overridden with a new number of tiers or new
381
+ * values for `maximum_units`, or `unit_amount`.
261
382
  *
262
383
  * ```json
263
384
  * {
264
- * ...
265
- * "id": "price_id",
266
- * "model_type": "bulk",
267
- * "bulk_config": {
268
- * "tiers": [
269
- * {
270
- * "maximum_units": "10",
271
- * "unit_amount": "0.50"
272
- * },
273
- * {
274
- * "maximum_units": "1000",
275
- * "unit_amount": "0.40"
276
- * }
277
- * ]
278
- * }
279
- * ...
385
+ * ...
386
+ * "id": "price_id",
387
+ * "model_type": "bulk",
388
+ * "bulk_config": {
389
+ * "tiers": [
390
+ * {
391
+ * "maximum_units": "10",
392
+ * "unit_amount": "0.50"
393
+ * },
394
+ * {
395
+ * "maximum_units": "1000",
396
+ * "unit_amount": "0.40"
397
+ * }
398
+ * ]
399
+ * }
400
+ * ...
280
401
  * }
281
402
  * ```
282
403
  * ### Package pricing
283
404
  *
284
- * Package pricing defines the size or granularity of a unit for billing purposes. For example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units will be billed at 10.
405
+ * Package pricing defines the size or granularity of a unit for billing purposes. For example, if the package size is set
406
+ * to 5, then 4 units will be billed as 5 and 6 units will be billed at 10.
285
407
  *
286
408
  * ```json
287
409
  * {
288
- * ...
289
- * "id": "price_id",
290
- * "model_type": "package",
291
- * "package_config": {
292
- * "package_amount": "0.80",
293
- * "package_size": 10
294
- * }
295
- * ...
296
- * }
297
- * ```
410
+ * ...
411
+ * "id": "price_id",
412
+ * "model_type": "package",
413
+ * "package_config": {
414
+ * "package_amount": "0.80",
415
+ * "package_size": 10
416
+ * }
417
+ * ...
418
+ * }
419
+ * ```
298
420
  * ### BPS pricing
299
421
  *
300
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the number of basis points to charge), as well as a cap per event to assess. For example, this would allow you to assess a fee of 0.25% on every payment you process, with a maximum charge of $25 per payment.
422
+ * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the number of basis points to
423
+ * charge), as well as a cap per event to assess. For example, this would allow you to assess a fee of 0.25% on every
424
+ * payment you process, with a maximum charge of $25 per payment.
301
425
  *
302
426
  * ```json
303
427
  * {
304
- * ...
305
- * "id": "price_id"
306
- * "model_type": "bps",
307
- * "bps_config": {
308
- * "bps": 125,
309
- * "per_event_cap": "11.00"
310
- * }
311
- * ...
312
- * }
428
+ * ...
429
+ * "id": "price_id"
430
+ * "model_type": "bps",
431
+ * "bps_config": {
432
+ * "bps": 125,
433
+ * "per_event_cap": "11.00"
434
+ * }
435
+ * ...
436
+ * }
313
437
  * ```
314
438
  * ### Bulk BPS pricing
315
439
  *
316
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity across all events. Similar to bulk pricing, the BPS parameters of a given event depends on the tier range that the billing period falls into. Each tier range is defined by an upper and lower bound. For example, after $1.5M of payment volume is reached, each individual payment may have a lower cap or a smaller take-rate.
440
+ * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity across all events. Similar
441
+ * to bulk pricing, the BPS parameters of a given event depends on the tier range that the billing period falls into. Each
442
+ * tier range is defined by an upper and lower bound. For example, after $1.5M of payment volume is reached, each
443
+ * individual payment may have a lower cap or a smaller take-rate.
317
444
  *
318
445
  * ```json
319
446
  * {
320
- * ...
321
- * "id": "price_id"
322
- * "model_type": "bulk_bps",
323
- * "bulk_bps_config": {
324
- * "tiers": [
325
- * {
326
- * "minimum_amount": "0.00",
327
- * "maximum_amount": "1000000.00",
328
- * "bps": 125,
329
- * "per_event_cap": "19.00"
330
- * },
331
- * {
332
- * "minimum_amount":"1000000.00",
333
- * "maximum_amount": null,
334
- * "bps": 115,
335
- * "per_event_cap": "4.00"
336
- * }
337
- * ]
338
- * }
339
- * ...
340
- * }
447
+ * ...
448
+ * "id": "price_id"
449
+ * "model_type": "bulk_bps",
450
+ * "bulk_bps_config": {
451
+ * "tiers": [
452
+ * {
453
+ * "minimum_amount": "0.00",
454
+ * "maximum_amount": "1000000.00",
455
+ * "bps": 125,
456
+ * "per_event_cap": "19.00"
457
+ * },
458
+ * {
459
+ * "minimum_amount":"1000000.00",
460
+ * "maximum_amount": null,
461
+ * "bps": 115,
462
+ * "per_event_cap": "4.00"
463
+ * }
464
+ * ]
465
+ * }
466
+ * ...
467
+ * }
341
468
  * ```
342
469
  * ### Tiered BPS pricing
343
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's applicable parameter is a function of its marginal addition to the period total. Similar to tiered pricing, the BPS parameters of a given event depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first few payments may have a 0.8 BPS take-rate and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
470
+ * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's applicable parameter is a function
471
+ * of its marginal addition to the period total. Similar to tiered pricing, the BPS parameters of a given event depends on
472
+ * the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first
473
+ * few payments may have a 0.8 BPS take-rate and all payments after a specific volume may incur a take-rate of 0.5 BPS
474
+ * each.
344
475
  *
345
476
  * ```json
346
477
  * {
347
- * ...
348
- * "id": "price_id"
349
- * "model_type": "tiered_bps",
350
- * "tiered_bps_config": {
351
- * "tiers": [
352
- * {
353
- * "minimum_amount": "0.00",
354
- * "maximum_amount": "1000000.00",
355
- * "bps": 125,
356
- * "per_event_cap": "19.00"
357
- * },
358
- * {
359
- * "minimum_amount":"1000000",
360
- * "maximum_amount": null,
361
- * "bps": 115,
362
- * "per_event_cap": "4.00"
363
- * }
364
- * ]
365
- * }
366
- * ...
367
- * }
478
+ * ...
479
+ * "id": "price_id"
480
+ * "model_type": "tiered_bps",
481
+ * "tiered_bps_config": {
482
+ * "tiers": [
483
+ * {
484
+ * "minimum_amount": "0.00",
485
+ * "maximum_amount": "1000000.00",
486
+ * "bps": 125,
487
+ * "per_event_cap": "19.00"
488
+ * },
489
+ * {
490
+ * "minimum_amount":"1000000",
491
+ * "maximum_amount": null,
492
+ * "bps": 115,
493
+ * "per_event_cap": "4.00"
494
+ * }
495
+ * ]
496
+ * }
497
+ * ...
498
+ * }
368
499
  * ```
369
500
  * ### Matrix pricing
370
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions` defines the two event property values evaluated in this pricing model. In a one-dimensional matrix, the second value is `null`. Every configuration has a list of `matrix_values` which give the unit prices for specified property values. In a one-dimensional matrix, the matrix values will have `dimension_values` where the second value of the pair is null. If an event does not match any of the dimension values in the matrix, it will resort to the `default_unit_amount`.
501
+ * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions` defines the two event
502
+ * property values evaluated in this pricing model. In a one-dimensional matrix, the second value is `null`. Every
503
+ * configuration has a list of `matrix_values` which give the unit prices for specified property values. In a
504
+ * one-dimensional matrix, the matrix values will have `dimension_values` where the second value of the pair is null. If an
505
+ * event does not match any of the dimension values in the matrix, it will resort to the `default_unit_amount`.
371
506
  * ```json
372
507
  * ...
373
508
  * "model_type": "matrix"
374
509
  * "matrix_config": {
375
- * "default_unit_amount": "3.00",
376
- * "dimensions": [
377
- * "cluster_name",
378
- * "region"
379
- * ],
380
- * "matrix_values": [
381
- * {
382
- * "dimension_values": [
383
- * "alpha",
384
- * "west"
385
- * ],
386
- * "unit_amount": "2.00"
387
- * },
388
- * ...
389
- * ]
510
+ * "default_unit_amount": "3.00",
511
+ * "dimensions": [
512
+ * "cluster_name",
513
+ * "region"
514
+ * ],
515
+ * "matrix_values": [
516
+ * {
517
+ * "dimension_values": [
518
+ * "alpha",
519
+ * "west"
520
+ * ],
521
+ * "unit_amount": "2.00"
522
+ * },
523
+ * ...
524
+ * ]
390
525
  * }
391
526
  * ...
392
527
  * ```
393
528
  *
394
529
  * ### Fixed fees
395
- * Fixed fees follow unit pricing, and also have an additional parameter `fixed_price_quantity` that indicates how many of a fixed fee that should be applied for a subscription. This parameter defaults to 1.
530
+ * Fixed fees follow unit pricing, and also have an additional parameter `fixed_price_quantity` that indicates how many of
531
+ * a fixed fee that should be applied for a subscription. This parameter defaults to 1.
396
532
  *
397
533
  * ```json
398
534
  * {
399
- * ...
400
- * "id": "price_id",
401
- * "model_type": "unit",
402
- * "unit_config": {
403
- * "unit_amount": "2.00"
404
- * },
405
- * "fixed_price_quantity": 3.0
406
- * ...
535
+ * ...
536
+ * "id": "price_id",
537
+ * "model_type": "unit",
538
+ * "unit_config": {
539
+ * "unit_amount": "2.00"
540
+ * },
541
+ * "fixed_price_quantity": 3.0
542
+ * ...
407
543
  * }
408
544
  * ```
409
545
  *
410
546
  * ## Maximums and Minimums
411
- * Minimums and maximums, much like price overrides, can be useful when a new customer has negotiated a new or different minimum or maximum spend cap than the default for the plan. Maximums and minimums can be added to either a price or a plan. If one exists for a price or plan and null is provided for the minimum/maximum override on creation, then there will be no minimum/maximum on the new subscription. If no value is provided, then the default plan maximum or minimum is used.
547
+ * Minimums and maximums, much like price overrides, can be useful when a new customer has negotiated a new or different
548
+ * minimum or maximum spend cap than the default for the plan. Maximums and minimums can be added to either a price or a
549
+ * plan. If one exists for a price or plan and null is provided for the minimum/maximum override on creation, then there
550
+ * will be no minimum/maximum on the new subscription. If no value is provided, then the default plan maximum or minimum is
551
+ * used.
412
552
  *
413
- * To add a minimum for a specific price, add `minimum_amount` to the specific price in the `price_overrides` object. To add a minimum to a plan, add `minimum_amount` to the base object. The value for `minimum_amount` should be a string with the minimum dollar amount in decimal format.
553
+ * To add a minimum for a specific price, add `minimum_amount` to the specific price in the `price_overrides` object. To
554
+ * add a minimum to a plan, add `minimum_amount` to the base object. The value for `minimum_amount` should be a string with
555
+ * the minimum dollar amount in decimal format.
414
556
  *
415
- * To add a maximum for a specific price, add `maximum_amount` to the specific price in the `price_overrides` object. To add a maximum to a plan, add `maximum_amount` to the base object. The value for `maximum_amount` should be a string with the maximum dollar amount in decimal format.
557
+ * To add a maximum for a specific price, add `maximum_amount` to the specific price in the `price_overrides` object. To
558
+ * add a maximum to a plan, add `maximum_amount` to the base object. The value for `maximum_amount` should be a string with
559
+ * the maximum dollar amount in decimal format.
416
560
  *
417
561
  *
418
562
  * ### Minimum override example
@@ -421,14 +565,14 @@ var Subscription = /** @class */ (function () {
421
565
  *
422
566
  * ```json
423
567
  * {
424
- * ...
425
- * "id": "price_id",
426
- * "model_type": "unit",
427
- * "unit_config": {
428
- * "unit_amount": "0.50"
429
- * },
430
- * "minimum_amount": "100.00"
431
- * ...
568
+ * ...
569
+ * "id": "price_id",
570
+ * "model_type": "unit",
571
+ * "unit_config": {
572
+ * "unit_amount": "0.50"
573
+ * },
574
+ * "minimum_amount": "100.00"
575
+ * ...
432
576
  * }
433
577
  * ```
434
578
  *
@@ -437,52 +581,56 @@ var Subscription = /** @class */ (function () {
437
581
  *
438
582
  * ```json
439
583
  * {
440
- * "customer_id": "customer_id",
441
- * "plan_id": "plan_id",
442
- * "minimum_amount": "1000.00",
443
- * "price_overrides": [ ... ]
444
- * ...
584
+ * "customer_id": "customer_id",
585
+ * "plan_id": "plan_id",
586
+ * "minimum_amount": "1000.00",
587
+ * "price_overrides": [ ... ]
588
+ * ...
445
589
  * }
446
590
  * ```
447
591
  *
448
592
  * Removing an existing minimum example
449
593
  * ```json
450
594
  * {
451
- * ...
452
- * "id": "price_id",
453
- * "model_type": "unit",
454
- * "unit_config": {
455
- * "unit_amount": "0.50"
456
- * },
457
- * "minimum_amount": null
458
- * ...
595
+ * ...
596
+ * "id": "price_id",
597
+ * "model_type": "unit",
598
+ * "unit_config": {
599
+ * "unit_amount": "0.50"
600
+ * },
601
+ * "minimum_amount": null
602
+ * ...
459
603
  * }
460
604
  * ```
461
605
  *
462
606
  * Using the plan's minimum example
463
607
  * ```json
464
608
  * {
465
- * ...
466
- * "id": "price_id",
467
- * "model_type": "unit",
468
- * "unit_config": {
469
- * "unit_amount": "0.50"
470
- * },
471
- * ...
609
+ * ...
610
+ * "id": "price_id",
611
+ * "model_type": "unit",
612
+ * "unit_config": {
613
+ * "unit_amount": "0.50"
614
+ * },
615
+ * ...
472
616
  * }
473
617
  * ```
474
618
  *
475
619
  * ## Discounts
476
- * Discounts, like price overrides, can be useful when a new customer has negotiated a new or different discount than the default for the plan. Discounts can be added to either a price or a plan, and a single plan or price can have at most one discount. If a discount exists for a price or a plan and a null discount is provided on creation, then there will be no discount on the new subscription.
620
+ * Discounts, like price overrides, can be useful when a new customer has negotiated a new or different discount than the
621
+ * default for the plan. Discounts can be added to either a price or a plan, and a single plan or price can have at most
622
+ * one discount. If a discount exists for a price or a plan and a null discount is provided on creation, then there will be
623
+ * no discount on the new subscription.
477
624
  *
478
- * To add a discount for a specific price, add `discount` to the price in the `price_overrides` object. To add a discount to a plan, add `discount` to the base object.
625
+ * To add a discount for a specific price, add `discount` to the price in the `price_overrides` object. To add a discount
626
+ * to a plan, add `discount` to the base object.
479
627
  * Discount should be a dictionary of the format:
480
628
  * ```json
481
629
  * {
482
- * "discount_type": "amount" | "percentage" | "usage",
483
- * "amount_discount": string,
484
- * "percentage_discount": string,
485
- * "usage_discount": string
630
+ * "discount_type": "amount" | "percentage" | "usage",
631
+ * "amount_discount": string,
632
+ * "percentage_discount": string,
633
+ * "usage_discount": string
486
634
  * }
487
635
  * ```
488
636
  * where either `amount_discount`, `percentage_discount`, or `usage_discount` is provided.
@@ -492,55 +640,61 @@ var Subscription = /** @class */ (function () {
492
640
  * Price discount example
493
641
  * ```json
494
642
  * {
495
- * ...
496
- * "id": "price_id",
497
- * "model_type": "unit",
498
- * "unit_config": {
499
- * "unit_amount": "0.50"
500
- * },
501
- * "discount": {"discount_type": "amount", "amount_discount": "175"},
643
+ * ...
644
+ * "id": "price_id",
645
+ * "model_type": "unit",
646
+ * "unit_config": {
647
+ * "unit_amount": "0.50"
648
+ * },
649
+ * "discount": {"discount_type": "amount", "amount_discount": "175"},
502
650
  * }
503
651
  * ```
504
652
  *
505
653
  * Plan discount example
506
654
  * ```json
507
655
  * {
508
- * "customer_id": "customer_id",
509
- * "plan_id": "plan_id",
510
- * "discount": {"discount_type": "percentage", "percentage_discount": "12.5"},
511
- * "price_overrides": [ ... ]
512
- * ...
656
+ * "customer_id": "customer_id",
657
+ * "plan_id": "plan_id",
658
+ * "discount": {"discount_type": "percentage", "percentage_discount": "12.5"},
659
+ * "price_overrides": [ ... ]
660
+ * ...
513
661
  * }
514
662
  * ```
515
663
  *
516
664
  * Removing an existing discount example
517
665
  * ```json
518
666
  * {
519
- * "customer_id": "customer_id",
520
- * "plan_id": "plan_id",
521
- * "discount": null,
522
- * "price_overrides": [ ... ]
523
- * ...
667
+ * "customer_id": "customer_id",
668
+ * "plan_id": "plan_id",
669
+ * "discount": null,
670
+ * "price_overrides": [ ... ]
671
+ * ...
524
672
  * }
525
673
  * ```
526
674
  *
527
675
  * Using the plan's discount example
528
676
  * ```json
529
677
  * {
530
- * ...
531
- * "id": "price_id",
532
- * "model_type": "unit",
533
- * "unit_config": {
534
- * "unit_amount": "0.50"
535
- * },
536
- * ...
678
+ * ...
679
+ * "id": "price_id",
680
+ * "model_type": "unit",
681
+ * "unit_config": {
682
+ * "unit_amount": "0.50"
683
+ * },
684
+ * ...
537
685
  * }
538
686
  * ```
687
+ *
688
+ * ## Threshold Billing
689
+ *
690
+ * Orb supports invoicing for a subscription when a preconfigured usage threshold is hit. To enable threshold billing, pass
691
+ * in an `invoicing_threshold`, which is specified in the subscription's invoicing currency, when creating a subscription.
692
+ * Ex. pass in `10.00` to issue an invoice when usage amounts hit $10.00 for a subscription that invoices in USD.
539
693
  */
540
694
  Subscription.prototype.create = function (req, config) {
541
695
  var _a, _b;
542
696
  return __awaiter(this, void 0, void 0, function () {
543
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
697
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
544
698
  var _d;
545
699
  return __generator(this, function (_e) {
546
700
  switch (_e.label) {
@@ -550,7 +704,7 @@ var Subscription = /** @class */ (function () {
550
704
  }
551
705
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
552
706
  url = baseURL.replace(/\/$/, "") + "/subscriptions";
553
- _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
707
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
554
708
  try {
555
709
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
556
710
  }
@@ -559,12 +713,23 @@ var Subscription = /** @class */ (function () {
559
713
  throw new Error("Error serializing request body, cause: ".concat(e.message));
560
714
  }
561
715
  }
562
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
563
- headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
716
+ client = this.sdkConfiguration.defaultClient;
717
+ globalSecurity = this.sdkConfiguration.security;
718
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
719
+ return [4 /*yield*/, globalSecurity()];
720
+ case 1:
721
+ globalSecurity = _e.sent();
722
+ _e.label = 2;
723
+ case 2:
724
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
725
+ globalSecurity = new shared.Security(globalSecurity);
726
+ }
727
+ properties = utils.parseSecurityProperties(globalSecurity);
728
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
564
729
  headers["Accept"] = "application/json";
565
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
730
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
566
731
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
567
- case 1:
732
+ case 3:
568
733
  httpRes = _e.sent();
569
734
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
570
735
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -577,10 +742,69 @@ var Subscription = /** @class */ (function () {
577
742
  });
578
743
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
579
744
  switch (true) {
580
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
745
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 201:
581
746
  if (utils.matchContentType(contentType, "application/json")) {
582
747
  res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
583
748
  }
749
+ else {
750
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
751
+ }
752
+ break;
753
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
754
+ if (utils.matchContentType(contentType, "application/json")) {
755
+ res.fourHundredError = JSON.parse(decodedRes);
756
+ }
757
+ else {
758
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
759
+ }
760
+ break;
761
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
762
+ if (utils.matchContentType(contentType, "application/json")) {
763
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
764
+ }
765
+ else {
766
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
767
+ }
768
+ break;
769
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
770
+ if (utils.matchContentType(contentType, "application/json")) {
771
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
772
+ }
773
+ else {
774
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
775
+ }
776
+ break;
777
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
778
+ if (utils.matchContentType(contentType, "application/json")) {
779
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
780
+ }
781
+ else {
782
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
783
+ }
784
+ break;
785
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
786
+ if (utils.matchContentType(contentType, "application/json")) {
787
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
788
+ }
789
+ else {
790
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
791
+ }
792
+ break;
793
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
794
+ if (utils.matchContentType(contentType, "application/json")) {
795
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
796
+ }
797
+ else {
798
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
799
+ }
800
+ break;
801
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
802
+ if (utils.matchContentType(contentType, "application/json")) {
803
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
804
+ }
805
+ else {
806
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
807
+ }
584
808
  break;
585
809
  }
586
810
  return [2 /*return*/, res];
@@ -597,7 +821,7 @@ var Subscription = /** @class */ (function () {
597
821
  Subscription.prototype.fetch = function (req, config) {
598
822
  var _a, _b;
599
823
  return __awaiter(this, void 0, void 0, function () {
600
- var baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
824
+ var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
601
825
  return __generator(this, function (_c) {
602
826
  switch (_c.label) {
603
827
  case 0:
@@ -606,12 +830,23 @@ var Subscription = /** @class */ (function () {
606
830
  }
607
831
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
608
832
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}", req);
609
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
610
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
833
+ client = this.sdkConfiguration.defaultClient;
834
+ globalSecurity = this.sdkConfiguration.security;
835
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
836
+ return [4 /*yield*/, globalSecurity()];
837
+ case 1:
838
+ globalSecurity = _c.sent();
839
+ _c.label = 2;
840
+ case 2:
841
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
842
+ globalSecurity = new shared.Security(globalSecurity);
843
+ }
844
+ properties = utils.parseSecurityProperties(globalSecurity);
845
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
611
846
  headers["Accept"] = "application/json";
612
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
847
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
613
848
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
614
- case 1:
849
+ case 3:
615
850
  httpRes = _c.sent();
616
851
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
617
852
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -628,6 +863,65 @@ var Subscription = /** @class */ (function () {
628
863
  if (utils.matchContentType(contentType, "application/json")) {
629
864
  res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
630
865
  }
866
+ else {
867
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
868
+ }
869
+ break;
870
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
871
+ if (utils.matchContentType(contentType, "application/json")) {
872
+ res.fourHundredError = JSON.parse(decodedRes);
873
+ }
874
+ else {
875
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
876
+ }
877
+ break;
878
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
879
+ if (utils.matchContentType(contentType, "application/json")) {
880
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
881
+ }
882
+ else {
883
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
884
+ }
885
+ break;
886
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
887
+ if (utils.matchContentType(contentType, "application/json")) {
888
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
889
+ }
890
+ else {
891
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
892
+ }
893
+ break;
894
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
895
+ if (utils.matchContentType(contentType, "application/json")) {
896
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
897
+ }
898
+ else {
899
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
900
+ }
901
+ break;
902
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
903
+ if (utils.matchContentType(contentType, "application/json")) {
904
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
905
+ }
906
+ else {
907
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
908
+ }
909
+ break;
910
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
911
+ if (utils.matchContentType(contentType, "application/json")) {
912
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
913
+ }
914
+ else {
915
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
916
+ }
917
+ break;
918
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
919
+ if (utils.matchContentType(contentType, "application/json")) {
920
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
921
+ }
922
+ else {
923
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
924
+ }
631
925
  break;
632
926
  }
633
927
  return [2 /*return*/, res];
@@ -639,15 +933,18 @@ var Subscription = /** @class */ (function () {
639
933
  * Fetch subscription costs
640
934
  *
641
935
  * @remarks
642
- * This endpoint is used to fetch a day-by-day snapshot of a subscription's costs in Orb, calculated by applying pricing information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage) to fetch usage per metric, in usage units rather than a currency).
936
+ * This endpoint is used to fetch a day-by-day snapshot of a subscription's costs in Orb, calculated by applying
937
+ * pricing information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage) to
938
+ * fetch usage per metric, in usage units rather than a currency).
643
939
  *
644
- *
645
- * The semantics of this endpoint exactly mirror those of [fetching a customer's costs](fetch-customer-costs). Use this endpoint to limit your analysis of costs to a specific subscription for the customer (e.g. to de-aggregate costs when a customer's subscription has started and stopped on the same day).
940
+ * The semantics of this endpoint exactly mirror those of [fetching a customer's costs](fetch-customer-costs). Use this
941
+ * endpoint to limit your analysis of costs to a specific subscription for the customer (e.g. to de-aggregate costs
942
+ * when a customer's subscription has started and stopped on the same day).
646
943
  */
647
944
  Subscription.prototype.fetchCosts = function (req, config) {
648
945
  var _a, _b;
649
946
  return __awaiter(this, void 0, void 0, function () {
650
- var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
947
+ var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
651
948
  return __generator(this, function (_c) {
652
949
  switch (_c.label) {
653
950
  case 0:
@@ -656,13 +953,24 @@ var Subscription = /** @class */ (function () {
656
953
  }
657
954
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
658
955
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/costs", req);
659
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
660
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
956
+ client = this.sdkConfiguration.defaultClient;
957
+ globalSecurity = this.sdkConfiguration.security;
958
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
959
+ return [4 /*yield*/, globalSecurity()];
960
+ case 1:
961
+ globalSecurity = _c.sent();
962
+ _c.label = 2;
963
+ case 2:
964
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
965
+ globalSecurity = new shared.Security(globalSecurity);
966
+ }
967
+ properties = utils.parseSecurityProperties(globalSecurity);
968
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
661
969
  queryParams = utils.serializeQueryParams(req);
662
970
  headers["Accept"] = "application/json";
663
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
971
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
664
972
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
665
- case 1:
973
+ case 3:
666
974
  httpRes = _c.sent();
667
975
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
668
976
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -679,6 +987,65 @@ var Subscription = /** @class */ (function () {
679
987
  if (utils.matchContentType(contentType, "application/json")) {
680
988
  res.subscriptionCosts = utils.objectToClass(JSON.parse(decodedRes), shared.SubscriptionCosts);
681
989
  }
990
+ else {
991
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
992
+ }
993
+ break;
994
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
995
+ if (utils.matchContentType(contentType, "application/json")) {
996
+ res.fourHundredError = JSON.parse(decodedRes);
997
+ }
998
+ else {
999
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1000
+ }
1001
+ break;
1002
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1003
+ if (utils.matchContentType(contentType, "application/json")) {
1004
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
1005
+ }
1006
+ else {
1007
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1008
+ }
1009
+ break;
1010
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
1011
+ if (utils.matchContentType(contentType, "application/json")) {
1012
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
1013
+ }
1014
+ else {
1015
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1016
+ }
1017
+ break;
1018
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
1019
+ if (utils.matchContentType(contentType, "application/json")) {
1020
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
1021
+ }
1022
+ else {
1023
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1024
+ }
1025
+ break;
1026
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
1027
+ if (utils.matchContentType(contentType, "application/json")) {
1028
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
1029
+ }
1030
+ else {
1031
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1032
+ }
1033
+ break;
1034
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1035
+ if (utils.matchContentType(contentType, "application/json")) {
1036
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
1037
+ }
1038
+ else {
1039
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1040
+ }
1041
+ break;
1042
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1043
+ if (utils.matchContentType(contentType, "application/json")) {
1044
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
1045
+ }
1046
+ else {
1047
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1048
+ }
682
1049
  break;
683
1050
  }
684
1051
  return [2 /*return*/, res];
@@ -690,12 +1057,14 @@ var Subscription = /** @class */ (function () {
690
1057
  * Fetch subscription schedule
691
1058
  *
692
1059
  * @remarks
693
- * This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a subscription along with their start and end dates. This list contains the subscription's initial plan along with past and future plan changes.
1060
+ * This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a subscription along
1061
+ * with their start and end dates. This list contains the subscription's initial plan along with past and future plan
1062
+ * changes.
694
1063
  */
695
1064
  Subscription.prototype.fetchSchedule = function (req, config) {
696
1065
  var _a, _b;
697
1066
  return __awaiter(this, void 0, void 0, function () {
698
- var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
1067
+ var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
699
1068
  return __generator(this, function (_c) {
700
1069
  switch (_c.label) {
701
1070
  case 0:
@@ -704,13 +1073,24 @@ var Subscription = /** @class */ (function () {
704
1073
  }
705
1074
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
706
1075
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/schedule", req);
707
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
708
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
1076
+ client = this.sdkConfiguration.defaultClient;
1077
+ globalSecurity = this.sdkConfiguration.security;
1078
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1079
+ return [4 /*yield*/, globalSecurity()];
1080
+ case 1:
1081
+ globalSecurity = _c.sent();
1082
+ _c.label = 2;
1083
+ case 2:
1084
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1085
+ globalSecurity = new shared.Security(globalSecurity);
1086
+ }
1087
+ properties = utils.parseSecurityProperties(globalSecurity);
1088
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
709
1089
  queryParams = utils.serializeQueryParams(req);
710
1090
  headers["Accept"] = "application/json";
711
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
1091
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
712
1092
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
713
- case 1:
1093
+ case 3:
714
1094
  httpRes = _c.sent();
715
1095
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
716
1096
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -725,7 +1105,66 @@ var Subscription = /** @class */ (function () {
725
1105
  switch (true) {
726
1106
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
727
1107
  if (utils.matchContentType(contentType, "application/json")) {
728
- res.subscriptionSchedule = utils.objectToClass(JSON.parse(decodedRes), shared.SubscriptionSchedule);
1108
+ res.subscriptionScheduleItems = utils.objectToClass(JSON.parse(decodedRes), shared.SubscriptionScheduleItems);
1109
+ }
1110
+ else {
1111
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1112
+ }
1113
+ break;
1114
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
1115
+ if (utils.matchContentType(contentType, "application/json")) {
1116
+ res.fourHundredError = JSON.parse(decodedRes);
1117
+ }
1118
+ else {
1119
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1120
+ }
1121
+ break;
1122
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1123
+ if (utils.matchContentType(contentType, "application/json")) {
1124
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
1125
+ }
1126
+ else {
1127
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1128
+ }
1129
+ break;
1130
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
1131
+ if (utils.matchContentType(contentType, "application/json")) {
1132
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
1133
+ }
1134
+ else {
1135
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1136
+ }
1137
+ break;
1138
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
1139
+ if (utils.matchContentType(contentType, "application/json")) {
1140
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
1141
+ }
1142
+ else {
1143
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1144
+ }
1145
+ break;
1146
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
1147
+ if (utils.matchContentType(contentType, "application/json")) {
1148
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
1149
+ }
1150
+ else {
1151
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1152
+ }
1153
+ break;
1154
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1155
+ if (utils.matchContentType(contentType, "application/json")) {
1156
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
1157
+ }
1158
+ else {
1159
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1160
+ }
1161
+ break;
1162
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1163
+ if (utils.matchContentType(contentType, "application/json")) {
1164
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
1165
+ }
1166
+ else {
1167
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
729
1168
  }
730
1169
  break;
731
1170
  }
@@ -738,68 +1177,92 @@ var Subscription = /** @class */ (function () {
738
1177
  * Fetch subscription usage
739
1178
  *
740
1179
  * @remarks
741
- * This endpoint is used to fetch a subscription's usage in Orb. Especially when combined with optional query parameters, this endpoint is a powerful way to build visualizations on top of Orb's event data and metrics.
1180
+ * This endpoint is used to fetch a subscription's usage in Orb. Especially when combined with optional query
1181
+ * parameters, this endpoint is a powerful way to build visualizations on top of Orb's event data and metrics.
742
1182
  *
743
- * With no query parameters specified, this endpoint returns usage for the subscription's _current billing period_ across each billable metric that participates in the subscription. Usage quantities returned are the result of evaluating the metric definition for the entirety of the customer's billing period.
1183
+ * With no query parameters specified, this endpoint returns usage for the subscription's _current billing period_
1184
+ * across each billable metric that participates in the subscription. Usage quantities returned are the result of
1185
+ * evaluating the metric definition for the entirety of the customer's billing period.
744
1186
  *
745
1187
  * ### Default response shape
1188
+ * Orb returns a `data` array with an object corresponding to each billable metric. Nested within this object is a
1189
+ * `usage` array which has a `quantity` value and a corresponding `timeframe_start` and `timeframe_end`. The `quantity`
1190
+ * value represents the calculated usage value for the billable metric over the specified timeframe (inclusive of the
1191
+ * `timeframe_start` timestamp and exclusive of the `timeframe_end` timestamp).
746
1192
  *
747
- * Orb returns a `data` array with an object corresponding to each billable metric. Nested within this object is a `usage` array which has a `quantity` value and a corresponding `timeframe_start` and `timeframe_end`. The `quantity` value represents the calculated usage value for the billable metric over the specified timeframe (inclusive of the `timeframe_start` timestamp and exclusive of the `timeframe_end` timestamp).
748
- *
749
- * Orb will include _every_ window in the response starting from the beginning of the billing period, even when there were no events (and therefore no usage) in the window. This increases the size of the response but prevents the caller from filling in gaps and handling cumbersome time-based logic.
1193
+ * Orb will include _every_ window in the response starting from the beginning of the billing period, even when there
1194
+ * were no events (and therefore no usage) in the window. This increases the size of the response but prevents the caller
1195
+ * from filling in gaps and handling cumbersome time-based logic.
750
1196
  *
751
- * The query parameters in this endpoint serve to override this behavior and provide some key functionality, as listed below. Note that this functionality can also be used _in conjunction_ with each other, e.g. to display grouped usage on a custom timeframe.
1197
+ * The query parameters in this endpoint serve to override this behavior and provide some key functionality, as listed
1198
+ * below. Note that this functionality can also be used _in conjunction_ with each other, e.g. to display grouped usage
1199
+ * on a custom timeframe.
752
1200
  *
753
1201
  * ## Custom timeframe
754
- *
755
- * In order to view usage for a custom timeframe rather than the current billing period, specify a `timeframe_start` and `timeframe_end`. This will calculate quantities for usage incurred between timeframe_start (inclusive) and timeframe_end (exclusive), i.e. `[timeframe_start, timeframe_end)`.
1202
+ * In order to view usage for a custom timeframe rather than the current billing period, specify a `timeframe_start` and
1203
+ * `timeframe_end`. This will calculate quantities for usage incurred between timeframe_start (inclusive) and timeframe_end
1204
+ * (exclusive), i.e. `[timeframe_start, timeframe_end)`.
756
1205
  *
757
1206
  * Note:
758
1207
  * - These timestamps must be specified in ISO 8601 format and UTC timezone, e.g. `2022-02-01T05:00:00Z`.
759
1208
  * - Both parameters must be specified if either is specified.
760
1209
  *
761
1210
  * ## Grouping by custom attributes
762
- * In order to view a single metric grouped by a specific _attribute_ that each event is tagged with (e.g. `cluster`), you must additionally specify a `billable_metric_id` and a `group_by` key. The `group_by` key denotes the event property on which to group.
1211
+ * In order to view a single metric grouped by a specific _attribute_ that each event is tagged with (e.g. `cluster`), you
1212
+ * must additionally specify a `billable_metric_id` and a `group_by` key. The `group_by` key denotes the event property on
1213
+ * which to group.
1214
+ *
1215
+ * When returning grouped usage, only usage for `billable_metric_id` is returned, and a separate object in the `data` array
1216
+ * is returned for each value of the `group_by` key present in your events. The `quantity` value is the result of evaluating
1217
+ * the billable metric for events filtered to a single value of the `group_by` key.
763
1218
  *
764
- * When returning grouped usage, only usage for `billable_metric_id` is returned, and a separate object in the `data` array is returned for each value of the `group_by` key present in your events. The `quantity` value is the result of evaluating the billable metric for events filtered to a single value of the `group_by` key.
1219
+ * Orb expects that events that match the billable metric will contain values in the `properties` dictionary that correspond
1220
+ * to the `group_by` key specified. By default, Orb will not return a `null` group (i.e. events that match the metric but
1221
+ * do not have the key set). Currently, it is only possible to view usage grouped by a single attribute at a time.
765
1222
  *
766
- * Orb expects that events that match the billable metric will contain values in the `properties` dictionary that correspond to the `group_by` key specified. By default, Orb will not return a `null` group (i.e. events that match the metric but do not have the key set). Currently, it is only possible to view usage grouped by a single attribute at a time.
1223
+ * When viewing grouped usage, Orb uses pagination to limit the response size to 1000 groups by default. If there are more
1224
+ * groups for a given subscription, pagination metadata in the response can be used to fetch all of the data.
767
1225
  *
768
- * The following example shows usage for an "API Requests" billable metric grouped by `region`. Note the extra `metric_group` dictionary in the response, which provides metadata about the group:
1226
+ * The following example shows usage for an "API Requests" billable metric grouped by `region`. Note the extra `metric_group`
1227
+ * dictionary in the response, which provides metadata about the group:
769
1228
  *
770
1229
  * ```json
771
1230
  * {
772
- * "data": [
773
- * {
774
- * "usage": [
1231
+ * "data": [
775
1232
  * {
776
- * "quantity": 0.19291,
777
- * "timeframe_start": "2021-10-01T07:00:00Z",
778
- * "timeframe_end": "2021-10-02T07:00:00Z",
1233
+ * "usage": [
1234
+ * {
1235
+ * "quantity": 0.19291,
1236
+ * "timeframe_start": "2021-10-01T07:00:00Z",
1237
+ * "timeframe_end": "2021-10-02T07:00:00Z",
1238
+ * },
1239
+ * ...
1240
+ * ],
1241
+ * "metric_group": {
1242
+ * "property_key": "region",
1243
+ * "property_value": "asia/pacific"
1244
+ * },
1245
+ * "billable_metric": {
1246
+ * "id": "Fe9pbpMk86xpwdGB",
1247
+ * "name": "API Requests"
1248
+ * },
1249
+ * "view_mode": "periodic"
779
1250
  * },
780
1251
  * ...
781
- * ],
782
- * “metric_group”: {
783
- * “property_key”: “region”,
784
- * “property_value”: “asia/pacific”
785
- * },
786
- * "billable_metric": {
787
- * "id": "Fe9pbpMk86xpwdGB",
788
- * "name": "API Requests"
789
- * },
790
- * "view_mode": "periodic"
791
- * },
792
- * ...
793
- * ]
1252
+ * ]
794
1253
  * }
795
1254
  * ```
796
1255
  *
1256
+ *
797
1257
  * ## Windowed usage
798
- * The `granularity` parameter can be used to _window_ the usage `quantity` value into periods. When not specified, usage is returned for the entirety of the time range.
1258
+ * The `granularity` parameter can be used to _window_ the usage `quantity` value into periods. When not specified, usage
1259
+ * is returned for the entirety of the time range.
799
1260
  *
800
- * When `granularity = day` is specified with a timeframe longer than a day, Orb will return a `quantity` value for each full day between `timeframe_start` and `timeframe_end`. Note that the days are demarcated by the _customer's local midnight_.
1261
+ * When `granularity = day` is specified with a timeframe longer than a day, Orb will return a `quantity` value for each
1262
+ * full day between `timeframe_start` and `timeframe_end`. Note that the days are demarcated by the _customer's local midnight_.
801
1263
  *
802
- * For example, with `timeframe_start = 2022-02-01T05:00:00Z`, `timeframe_end = 2022-02-04T01:00:00Z` and `granularity=day`, the following windows will be returned for a customer in the `America/Los_Angeles` timezone since local midnight is `08:00` UTC:
1264
+ * For example, with `timeframe_start = 2022-02-01T05:00:00Z`, `timeframe_end = 2022-02-04T01:00:00Z` and `granularity=day`,
1265
+ * the following windows will be returned for a customer in the `America/Los_Angeles` timezone since local midnight is `08:00` UTC:
803
1266
  * - `[2022-02-01T05:00:00Z, 2022-02-01T08:00:00Z)`
804
1267
  * - `[2022-02-01T08:00:00, 2022-02-02T08:00:00Z)`
805
1268
  * - `[2022-02-02T08:00:00, 2022-02-03T08:00:00Z)`
@@ -820,6 +1283,7 @@ var Subscription = /** @class */ (function () {
820
1283
  * "timeframe_start": "2022-02-01T05:00:00+00:00"
821
1284
  * },
822
1285
  * {
1286
+ *
823
1287
  * "quantity": 0,
824
1288
  * "timeframe_end": "2022-02-02T08:00:00+00:00",
825
1289
  * "timeframe_start": "2022-02-01T08:00:00+00:00"
@@ -843,18 +1307,27 @@ var Subscription = /** @class */ (function () {
843
1307
  * ```
844
1308
  *
845
1309
  * ## Decomposable vs. non-decomposable metrics
846
- * Billable metrics fall into one of two categories: decomposable and non-decomposable. A decomposable billable metric, such as a sum or a count, can be displayed and aggregated across arbitrary timescales. On the other hand, a non-decomposable metric is not meaningful when only a slice of the billing window is considered.
1310
+ * Billable metrics fall into one of two categories: decomposable and non-decomposable. A decomposable billable metric, such as
1311
+ * a sum or a count, can be displayed and aggregated across arbitrary timescales. On the other hand, a non-decomposable metric
1312
+ * is not meaningful when only a slice of the billing window is considered.
847
1313
  *
848
- * As an example, if we have a billable metric that's defined to count unique users, displaying a graph of unique users for each day is not representative of the billable metric value over the month (days could have an overlapping set of 'unique' users). Instead, what's useful for any given day is the number of unique users in the billing period so far, which are the _cumulative_ unique users.
1314
+ * As an example, if we have a billable metric that's defined to count unique users, displaying a graph of unique users for each
1315
+ * day is not representative of the billable metric value over the month (days could have an overlapping set of 'unique' users).
1316
+ * Instead, what's useful for any given day is the number of unique users in the billing period so far, which are the
1317
+ * _cumulative_ unique users.
849
1318
  *
850
1319
  * Accordingly, this endpoint returns treats these two types of metrics differently when `group_by` is specified:
851
1320
  * - Decomposable metrics can be grouped by any event property.
852
- * - Non-decomposable metrics can only be grouped by the corresponding price's invoice grouping key. If no invoice grouping key is present, the metric does not support `group_by`.
1321
+ * - Non-decomposable metrics can only be grouped by the corresponding price's invoice grouping key. If no invoice grouping key
1322
+ * is present, the metric does not support `group_by`.
853
1323
  *
854
1324
  * ## Matrix prices
855
- * When a billable metric is attached to a price that uses matrix pricing, it's important to view usage grouped by those matrix dimensions. In this case, use the query parameters `first_dimension_key`, `first_dimension_value` and `second_dimension_key`, `second_dimension_value` while filtering to a specific `billable_metric_id`.
1325
+ * When a billable metric is attached to a price that uses matrix pricing, it's important to view usage grouped by those matrix
1326
+ * dimensions. In this case, use the query parameters `first_dimension_key`, `first_dimension_value` and `second_dimension_key`,
1327
+ * `second_dimension_value` while filtering to a specific `billable_metric_id`.
856
1328
  *
857
- * For example, if your compute metric has a separate unit price (i.e. a matrix pricing model) per `region` and `provider`, your request might provide the following parameters:
1329
+ * For example, if your compute metric has a separate unit price (i.e. a matrix pricing model) per `region` and `provider`,
1330
+ * your request might provide the following parameters:
858
1331
  *
859
1332
  * - `first_dimension_key`: `region`
860
1333
  * - `first_dimension_value`: `us-east-1`
@@ -864,7 +1337,7 @@ var Subscription = /** @class */ (function () {
864
1337
  Subscription.prototype.fetchUsage = function (req, config) {
865
1338
  var _a, _b;
866
1339
  return __awaiter(this, void 0, void 0, function () {
867
- var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
1340
+ var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
868
1341
  return __generator(this, function (_c) {
869
1342
  switch (_c.label) {
870
1343
  case 0:
@@ -873,13 +1346,24 @@ var Subscription = /** @class */ (function () {
873
1346
  }
874
1347
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
875
1348
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/usage", req);
876
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
877
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
1349
+ client = this.sdkConfiguration.defaultClient;
1350
+ globalSecurity = this.sdkConfiguration.security;
1351
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1352
+ return [4 /*yield*/, globalSecurity()];
1353
+ case 1:
1354
+ globalSecurity = _c.sent();
1355
+ _c.label = 2;
1356
+ case 2:
1357
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1358
+ globalSecurity = new shared.Security(globalSecurity);
1359
+ }
1360
+ properties = utils.parseSecurityProperties(globalSecurity);
1361
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
878
1362
  queryParams = utils.serializeQueryParams(req);
879
1363
  headers["Accept"] = "application/json";
880
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
1364
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
881
1365
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
882
- case 1:
1366
+ case 3:
883
1367
  httpRes = _c.sent();
884
1368
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
885
1369
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -894,27 +1378,89 @@ var Subscription = /** @class */ (function () {
894
1378
  switch (true) {
895
1379
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
896
1380
  if (utils.matchContentType(contentType, "application/json")) {
897
- res.subscriptionUsage = utils.objectToClass(JSON.parse(decodedRes), shared.SubscriptionUsage);
1381
+ res.subscriptionUsage = JSON.parse(decodedRes);
1382
+ }
1383
+ else {
1384
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
898
1385
  }
899
1386
  break;
900
- }
901
- return [2 /*return*/, res];
902
- }
903
- });
904
- });
905
- };
906
- /**
1387
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
1388
+ if (utils.matchContentType(contentType, "application/json")) {
1389
+ res.fourHundredError = JSON.parse(decodedRes);
1390
+ }
1391
+ else {
1392
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1393
+ }
1394
+ break;
1395
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1396
+ if (utils.matchContentType(contentType, "application/json")) {
1397
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
1398
+ }
1399
+ else {
1400
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1401
+ }
1402
+ break;
1403
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
1404
+ if (utils.matchContentType(contentType, "application/json")) {
1405
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
1406
+ }
1407
+ else {
1408
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1409
+ }
1410
+ break;
1411
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
1412
+ if (utils.matchContentType(contentType, "application/json")) {
1413
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
1414
+ }
1415
+ else {
1416
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1417
+ }
1418
+ break;
1419
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
1420
+ if (utils.matchContentType(contentType, "application/json")) {
1421
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
1422
+ }
1423
+ else {
1424
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1425
+ }
1426
+ break;
1427
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1428
+ if (utils.matchContentType(contentType, "application/json")) {
1429
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
1430
+ }
1431
+ else {
1432
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1433
+ }
1434
+ break;
1435
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1436
+ if (utils.matchContentType(contentType, "application/json")) {
1437
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
1438
+ }
1439
+ else {
1440
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1441
+ }
1442
+ break;
1443
+ }
1444
+ return [2 /*return*/, res];
1445
+ }
1446
+ });
1447
+ });
1448
+ };
1449
+ /**
907
1450
  * List subscriptions
908
1451
  *
909
1452
  * @remarks
910
- * This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list, ordered starting from the most recently created subscription. For a full discussion of the subscription resource, see [Subscription](../guides/concepts#subscription).
1453
+ * This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list,
1454
+ * ordered starting from the most recently created subscription. For a full discussion of the subscription resource,
1455
+ * see [Subscription](../guides/concepts#subscription).
911
1456
  *
912
- * Subscriptions can be filtered to a single customer by passing in the `customer_id` query parameter or the `external_customer_id` query parameter.
1457
+ * Subscriptions can be filtered to a single customer by
1458
+ * passing in the `customer_id` query parameter or the `external_customer_id` query parameter.
913
1459
  */
914
1460
  Subscription.prototype.list = function (req, config) {
915
1461
  var _a, _b;
916
1462
  return __awaiter(this, void 0, void 0, function () {
917
- var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
1463
+ var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
918
1464
  return __generator(this, function (_c) {
919
1465
  switch (_c.label) {
920
1466
  case 0:
@@ -923,13 +1469,24 @@ var Subscription = /** @class */ (function () {
923
1469
  }
924
1470
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
925
1471
  url = baseURL.replace(/\/$/, "") + "/subscriptions";
926
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
927
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
1472
+ client = this.sdkConfiguration.defaultClient;
1473
+ globalSecurity = this.sdkConfiguration.security;
1474
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1475
+ return [4 /*yield*/, globalSecurity()];
1476
+ case 1:
1477
+ globalSecurity = _c.sent();
1478
+ _c.label = 2;
1479
+ case 2:
1480
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1481
+ globalSecurity = new shared.Security(globalSecurity);
1482
+ }
1483
+ properties = utils.parseSecurityProperties(globalSecurity);
1484
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
928
1485
  queryParams = utils.serializeQueryParams(req);
929
1486
  headers["Accept"] = "application/json";
930
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
1487
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
931
1488
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
932
- case 1:
1489
+ case 3:
933
1490
  httpRes = _c.sent();
934
1491
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
935
1492
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -946,6 +1503,65 @@ var Subscription = /** @class */ (function () {
946
1503
  if (utils.matchContentType(contentType, "application/json")) {
947
1504
  res.subscriptions = utils.objectToClass(JSON.parse(decodedRes), shared.Subscriptions);
948
1505
  }
1506
+ else {
1507
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1508
+ }
1509
+ break;
1510
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
1511
+ if (utils.matchContentType(contentType, "application/json")) {
1512
+ res.fourHundredError = JSON.parse(decodedRes);
1513
+ }
1514
+ else {
1515
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1516
+ }
1517
+ break;
1518
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1519
+ if (utils.matchContentType(contentType, "application/json")) {
1520
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
1521
+ }
1522
+ else {
1523
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1524
+ }
1525
+ break;
1526
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
1527
+ if (utils.matchContentType(contentType, "application/json")) {
1528
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
1529
+ }
1530
+ else {
1531
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1532
+ }
1533
+ break;
1534
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
1535
+ if (utils.matchContentType(contentType, "application/json")) {
1536
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
1537
+ }
1538
+ else {
1539
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1540
+ }
1541
+ break;
1542
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
1543
+ if (utils.matchContentType(contentType, "application/json")) {
1544
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
1545
+ }
1546
+ else {
1547
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1548
+ }
1549
+ break;
1550
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1551
+ if (utils.matchContentType(contentType, "application/json")) {
1552
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
1553
+ }
1554
+ else {
1555
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1556
+ }
1557
+ break;
1558
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1559
+ if (utils.matchContentType(contentType, "application/json")) {
1560
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
1561
+ }
1562
+ else {
1563
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1564
+ }
949
1565
  break;
950
1566
  }
951
1567
  return [2 /*return*/, res];
@@ -957,30 +1573,39 @@ var Subscription = /** @class */ (function () {
957
1573
  * Schedule plan change
958
1574
  *
959
1575
  * @remarks
960
- * This endpoint can be used to change the plan on an existing subscription. It returns the serialized updated subscription object.
1576
+ * This endpoint can be used to change the plan on an existing subscription. It returns the serialized updated
1577
+ * subscription object.
961
1578
  *
962
1579
  * The body parameter `change_option` determines the timing of the plan change. Orb supports three options:
963
- *
964
1580
  * - `end_of_subscription_term`: changes the plan at the end of the existing plan's term.
965
- * - Issuing this plan change request for a monthly subscription will keep the existing plan active until the start of the subsequent month, and potentially issue an invoice for any usage charges incurred in the intervening period.
966
- * - Issuing this plan change request for a yearly subscription will keep the existing plan active for the full year.
967
- *
968
- * - `immediate`: changes the plan immediately. Subscriptions that have their plan changed with this option will be invoiced immediately. This invoice will include any usage fees incurred in the billing period up to the change, along with any prorated recurring fees for the billing period, if applicable.
969
- *
970
- * - `requested_date`: changes the plan on the requested date (`change_date`). If no timezone is provided, the customer's timezone is used. The `change_date` body parameter is required if this option is chosen.
1581
+ * - Issuing this plan change request for a monthly subscription will keep the existing plan active until the start
1582
+ * of the subsequent month, and potentially issue an invoice for any usage charges incurred in the intervening
1583
+ * period.
1584
+ * - Issuing this plan change request for a yearly subscription will keep the existing plan active for the full
1585
+ * year.
1586
+ * - `immediate`: changes the plan immediately. Subscriptions that have their plan changed with this option will be
1587
+ * invoiced immediately. This invoice will include any usage fees incurred in the billing period up to the change,
1588
+ * along with any prorated recurring fees for the billing period, if applicable.
1589
+ * - `requested_date`: changes the plan on the requested date (`change_date`). If no timezone is provided, the
1590
+ * customer's timezone is used. The `change_date` body parameter is required if this option is chosen.
971
1591
  *
972
1592
  * Note that one of `plan_id` or `external_plan_id` is required in the request body for this operation.
973
1593
  *
974
1594
  * ## Price overrides, maximums, and minimums
975
- * Price overrides are used to update some or all prices in the target plan. Minimums and maximums, much like price overrides, can be useful when a new customer has negotiated a new or different minimum or maximum spend cap than the default for the plan. The request format for price overrides, maximums, and minimums are the same as those in [subscription creation](create-subscription).
1595
+ * Price overrides are used to update some or all prices in the target plan. Minimums and maximums, much like price
1596
+ * overrides, can be useful when a new customer has negotiated a new or different minimum or maximum spend cap than the
1597
+ * default for the plan. The request format for price overrides, maximums, and minimums are the same as those in
1598
+ * [subscription creation](create-subscription).
976
1599
  *
977
1600
  * ## Prorations for in-advance fees
978
- * By default, Orb calculates the prorated difference in any fixed fees when making a plan change, adjusting the customer balance as needed. For details on this behavior, see [Subscription management](../guides/product-catalog/subscription-management.md).
1601
+ * By default, Orb calculates the prorated difference in any fixed fees when making a plan change, adjusting the
1602
+ * customer balance as needed. For details on this behavior, see
1603
+ * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees).
979
1604
  */
980
1605
  Subscription.prototype.schedulePlanChange = function (req, config) {
981
1606
  var _a, _b;
982
1607
  return __awaiter(this, void 0, void 0, function () {
983
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
1608
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
984
1609
  var _d;
985
1610
  return __generator(this, function (_e) {
986
1611
  switch (_e.label) {
@@ -990,7 +1615,7 @@ var Subscription = /** @class */ (function () {
990
1615
  }
991
1616
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
992
1617
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/schedule_plan_change", req);
993
- _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1618
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
994
1619
  try {
995
1620
  _d = __read(utils.serializeRequestBody(req, "subscriptionPlanChange", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
996
1621
  }
@@ -999,12 +1624,23 @@ var Subscription = /** @class */ (function () {
999
1624
  throw new Error("Error serializing request body, cause: ".concat(e.message));
1000
1625
  }
1001
1626
  }
1002
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
1003
- headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
1627
+ client = this.sdkConfiguration.defaultClient;
1628
+ globalSecurity = this.sdkConfiguration.security;
1629
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1630
+ return [4 /*yield*/, globalSecurity()];
1631
+ case 1:
1632
+ globalSecurity = _e.sent();
1633
+ _e.label = 2;
1634
+ case 2:
1635
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1636
+ globalSecurity = new shared.Security(globalSecurity);
1637
+ }
1638
+ properties = utils.parseSecurityProperties(globalSecurity);
1639
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1004
1640
  headers["Accept"] = "application/json";
1005
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
1641
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1006
1642
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1007
- case 1:
1643
+ case 3:
1008
1644
  httpRes = _e.sent();
1009
1645
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1010
1646
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -1021,6 +1657,192 @@ var Subscription = /** @class */ (function () {
1021
1657
  if (utils.matchContentType(contentType, "application/json")) {
1022
1658
  res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1023
1659
  }
1660
+ else {
1661
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1662
+ }
1663
+ break;
1664
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
1665
+ if (utils.matchContentType(contentType, "application/json")) {
1666
+ res.fourHundredError = JSON.parse(decodedRes);
1667
+ }
1668
+ else {
1669
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1670
+ }
1671
+ break;
1672
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1673
+ if (utils.matchContentType(contentType, "application/json")) {
1674
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
1675
+ }
1676
+ else {
1677
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1678
+ }
1679
+ break;
1680
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
1681
+ if (utils.matchContentType(contentType, "application/json")) {
1682
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
1683
+ }
1684
+ else {
1685
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1686
+ }
1687
+ break;
1688
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
1689
+ if (utils.matchContentType(contentType, "application/json")) {
1690
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
1691
+ }
1692
+ else {
1693
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1694
+ }
1695
+ break;
1696
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
1697
+ if (utils.matchContentType(contentType, "application/json")) {
1698
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
1699
+ }
1700
+ else {
1701
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1702
+ }
1703
+ break;
1704
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1705
+ if (utils.matchContentType(contentType, "application/json")) {
1706
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
1707
+ }
1708
+ else {
1709
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1710
+ }
1711
+ break;
1712
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1713
+ if (utils.matchContentType(contentType, "application/json")) {
1714
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
1715
+ }
1716
+ else {
1717
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1718
+ }
1719
+ break;
1720
+ }
1721
+ return [2 /*return*/, res];
1722
+ }
1723
+ });
1724
+ });
1725
+ };
1726
+ /**
1727
+ * Trigger phase
1728
+ *
1729
+ * @remarks
1730
+ * Manually trigger a phase, effective the given date (or the current time, if not specified).
1731
+ */
1732
+ Subscription.prototype.triggerPhase = function (req, config) {
1733
+ var _a, _b;
1734
+ return __awaiter(this, void 0, void 0, function () {
1735
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1736
+ var _d;
1737
+ return __generator(this, function (_e) {
1738
+ switch (_e.label) {
1739
+ case 0:
1740
+ if (!(req instanceof utils.SpeakeasyBase)) {
1741
+ req = new operations.TriggerPhaseRequest(req);
1742
+ }
1743
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1744
+ url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/trigger_phase", req);
1745
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1746
+ try {
1747
+ _d = __read(utils.serializeRequestBody(req, "triggerSubscriptionPhaseParams", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1748
+ }
1749
+ catch (e) {
1750
+ if (e instanceof Error) {
1751
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
1752
+ }
1753
+ }
1754
+ client = this.sdkConfiguration.defaultClient;
1755
+ globalSecurity = this.sdkConfiguration.security;
1756
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1757
+ return [4 /*yield*/, globalSecurity()];
1758
+ case 1:
1759
+ globalSecurity = _e.sent();
1760
+ _e.label = 2;
1761
+ case 2:
1762
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1763
+ globalSecurity = new shared.Security(globalSecurity);
1764
+ }
1765
+ properties = utils.parseSecurityProperties(globalSecurity);
1766
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1767
+ headers["Accept"] = "application/json";
1768
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1769
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1770
+ case 3:
1771
+ httpRes = _e.sent();
1772
+ contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1773
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1774
+ throw new Error("status code not found in response: ".concat(httpRes));
1775
+ }
1776
+ res = new operations.TriggerPhaseResponse({
1777
+ statusCode: httpRes.status,
1778
+ contentType: contentType,
1779
+ rawResponse: httpRes,
1780
+ });
1781
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1782
+ switch (true) {
1783
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1784
+ if (utils.matchContentType(contentType, "application/json")) {
1785
+ res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1786
+ }
1787
+ else {
1788
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1789
+ }
1790
+ break;
1791
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
1792
+ if (utils.matchContentType(contentType, "application/json")) {
1793
+ res.fourHundredError = JSON.parse(decodedRes);
1794
+ }
1795
+ else {
1796
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1797
+ }
1798
+ break;
1799
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1800
+ if (utils.matchContentType(contentType, "application/json")) {
1801
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
1802
+ }
1803
+ else {
1804
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1805
+ }
1806
+ break;
1807
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
1808
+ if (utils.matchContentType(contentType, "application/json")) {
1809
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
1810
+ }
1811
+ else {
1812
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1813
+ }
1814
+ break;
1815
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
1816
+ if (utils.matchContentType(contentType, "application/json")) {
1817
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
1818
+ }
1819
+ else {
1820
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1821
+ }
1822
+ break;
1823
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
1824
+ if (utils.matchContentType(contentType, "application/json")) {
1825
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
1826
+ }
1827
+ else {
1828
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1829
+ }
1830
+ break;
1831
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1832
+ if (utils.matchContentType(contentType, "application/json")) {
1833
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
1834
+ }
1835
+ else {
1836
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1837
+ }
1838
+ break;
1839
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1840
+ if (utils.matchContentType(contentType, "application/json")) {
1841
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
1842
+ }
1843
+ else {
1844
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1845
+ }
1024
1846
  break;
1025
1847
  }
1026
1848
  return [2 /*return*/, res];
@@ -1034,12 +1856,13 @@ var Subscription = /** @class */ (function () {
1034
1856
  * @remarks
1035
1857
  * This endpoint can be used to unschedule any pending cancellations for a subscription.
1036
1858
  *
1037
- * To be eligible, the subscription must currently be active and have a future cancellation. This operation will turn on auto-renew, ensuring that the subscription does not end at the currently scheduled cancellation time.
1859
+ * To be eligible, the subscription must currently be active and have a future cancellation. This operation will turn
1860
+ * on auto-renew, ensuring that the subscription does not end at the currently scheduled cancellation time.
1038
1861
  */
1039
1862
  Subscription.prototype.unscheduleCancellation = function (req, config) {
1040
1863
  var _a, _b;
1041
1864
  return __awaiter(this, void 0, void 0, function () {
1042
- var baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
1865
+ var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1043
1866
  return __generator(this, function (_c) {
1044
1867
  switch (_c.label) {
1045
1868
  case 0:
@@ -1048,12 +1871,23 @@ var Subscription = /** @class */ (function () {
1048
1871
  }
1049
1872
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1050
1873
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/unschedule_cancellation", req);
1051
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
1052
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
1874
+ client = this.sdkConfiguration.defaultClient;
1875
+ globalSecurity = this.sdkConfiguration.security;
1876
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1877
+ return [4 /*yield*/, globalSecurity()];
1878
+ case 1:
1879
+ globalSecurity = _c.sent();
1880
+ _c.label = 2;
1881
+ case 2:
1882
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1883
+ globalSecurity = new shared.Security(globalSecurity);
1884
+ }
1885
+ properties = utils.parseSecurityProperties(globalSecurity);
1886
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1053
1887
  headers["Accept"] = "application/json";
1054
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
1888
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1055
1889
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer" }, config))];
1056
- case 1:
1890
+ case 3:
1057
1891
  httpRes = _c.sent();
1058
1892
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1059
1893
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -1070,6 +1904,194 @@ var Subscription = /** @class */ (function () {
1070
1904
  if (utils.matchContentType(contentType, "application/json")) {
1071
1905
  res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1072
1906
  }
1907
+ else {
1908
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1909
+ }
1910
+ break;
1911
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
1912
+ if (utils.matchContentType(contentType, "application/json")) {
1913
+ res.fourHundredError = JSON.parse(decodedRes);
1914
+ }
1915
+ else {
1916
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1917
+ }
1918
+ break;
1919
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1920
+ if (utils.matchContentType(contentType, "application/json")) {
1921
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
1922
+ }
1923
+ else {
1924
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1925
+ }
1926
+ break;
1927
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
1928
+ if (utils.matchContentType(contentType, "application/json")) {
1929
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
1930
+ }
1931
+ else {
1932
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1933
+ }
1934
+ break;
1935
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
1936
+ if (utils.matchContentType(contentType, "application/json")) {
1937
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
1938
+ }
1939
+ else {
1940
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1941
+ }
1942
+ break;
1943
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
1944
+ if (utils.matchContentType(contentType, "application/json")) {
1945
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
1946
+ }
1947
+ else {
1948
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1949
+ }
1950
+ break;
1951
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1952
+ if (utils.matchContentType(contentType, "application/json")) {
1953
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
1954
+ }
1955
+ else {
1956
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1957
+ }
1958
+ break;
1959
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1960
+ if (utils.matchContentType(contentType, "application/json")) {
1961
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
1962
+ }
1963
+ else {
1964
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1965
+ }
1966
+ break;
1967
+ }
1968
+ return [2 /*return*/, res];
1969
+ }
1970
+ });
1971
+ });
1972
+ };
1973
+ /**
1974
+ * Unschedule fixed fee quantity updates
1975
+ *
1976
+ * @remarks
1977
+ * This endpoint can be used to clear scheduled updates to the quantity for a fixed fee.
1978
+ *
1979
+ * If there are no updates scheduled, this endpoint is a no-op.
1980
+ */
1981
+ Subscription.prototype.unscheduleFixedFeeQuantity = function (req, config) {
1982
+ var _a, _b;
1983
+ return __awaiter(this, void 0, void 0, function () {
1984
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1985
+ var _d;
1986
+ return __generator(this, function (_e) {
1987
+ switch (_e.label) {
1988
+ case 0:
1989
+ if (!(req instanceof utils.SpeakeasyBase)) {
1990
+ req = new operations.UnscheduleFixedFeeQuantityRequest(req);
1991
+ }
1992
+ baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1993
+ url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/unschedule_fixed_fee_quantity_updates", req);
1994
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1995
+ try {
1996
+ _d = __read(utils.serializeRequestBody(req, "unscheduleFixedFeeQuantityChangeParams", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1997
+ }
1998
+ catch (e) {
1999
+ if (e instanceof Error) {
2000
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
2001
+ }
2002
+ }
2003
+ client = this.sdkConfiguration.defaultClient;
2004
+ globalSecurity = this.sdkConfiguration.security;
2005
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
2006
+ return [4 /*yield*/, globalSecurity()];
2007
+ case 1:
2008
+ globalSecurity = _e.sent();
2009
+ _e.label = 2;
2010
+ case 2:
2011
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
2012
+ globalSecurity = new shared.Security(globalSecurity);
2013
+ }
2014
+ properties = utils.parseSecurityProperties(globalSecurity);
2015
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
2016
+ headers["Accept"] = "application/json";
2017
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
2018
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2019
+ case 3:
2020
+ httpRes = _e.sent();
2021
+ contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
2022
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
2023
+ throw new Error("status code not found in response: ".concat(httpRes));
2024
+ }
2025
+ res = new operations.UnscheduleFixedFeeQuantityResponse({
2026
+ statusCode: httpRes.status,
2027
+ contentType: contentType,
2028
+ rawResponse: httpRes,
2029
+ });
2030
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
2031
+ switch (true) {
2032
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
2033
+ if (utils.matchContentType(contentType, "application/json")) {
2034
+ res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
2035
+ }
2036
+ else {
2037
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2038
+ }
2039
+ break;
2040
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
2041
+ if (utils.matchContentType(contentType, "application/json")) {
2042
+ res.fourHundredError = JSON.parse(decodedRes);
2043
+ }
2044
+ else {
2045
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2046
+ }
2047
+ break;
2048
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
2049
+ if (utils.matchContentType(contentType, "application/json")) {
2050
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
2051
+ }
2052
+ else {
2053
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2054
+ }
2055
+ break;
2056
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
2057
+ if (utils.matchContentType(contentType, "application/json")) {
2058
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
2059
+ }
2060
+ else {
2061
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2062
+ }
2063
+ break;
2064
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
2065
+ if (utils.matchContentType(contentType, "application/json")) {
2066
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
2067
+ }
2068
+ else {
2069
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2070
+ }
2071
+ break;
2072
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
2073
+ if (utils.matchContentType(contentType, "application/json")) {
2074
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
2075
+ }
2076
+ else {
2077
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2078
+ }
2079
+ break;
2080
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
2081
+ if (utils.matchContentType(contentType, "application/json")) {
2082
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
2083
+ }
2084
+ else {
2085
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2086
+ }
2087
+ break;
2088
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
2089
+ if (utils.matchContentType(contentType, "application/json")) {
2090
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
2091
+ }
2092
+ else {
2093
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2094
+ }
1073
2095
  break;
1074
2096
  }
1075
2097
  return [2 /*return*/, res];
@@ -1086,7 +2108,7 @@ var Subscription = /** @class */ (function () {
1086
2108
  Subscription.prototype.unschedulePlanChange = function (req, config) {
1087
2109
  var _a, _b;
1088
2110
  return __awaiter(this, void 0, void 0, function () {
1089
- var baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
2111
+ var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1090
2112
  return __generator(this, function (_c) {
1091
2113
  switch (_c.label) {
1092
2114
  case 0:
@@ -1095,12 +2117,23 @@ var Subscription = /** @class */ (function () {
1095
2117
  }
1096
2118
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1097
2119
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/unschedule_pending_plan_changes", req);
1098
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
1099
- headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
2120
+ client = this.sdkConfiguration.defaultClient;
2121
+ globalSecurity = this.sdkConfiguration.security;
2122
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
2123
+ return [4 /*yield*/, globalSecurity()];
2124
+ case 1:
2125
+ globalSecurity = _c.sent();
2126
+ _c.label = 2;
2127
+ case 2:
2128
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
2129
+ globalSecurity = new shared.Security(globalSecurity);
2130
+ }
2131
+ properties = utils.parseSecurityProperties(globalSecurity);
2132
+ headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1100
2133
  headers["Accept"] = "application/json";
1101
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
2134
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1102
2135
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer" }, config))];
1103
- case 1:
2136
+ case 3:
1104
2137
  httpRes = _c.sent();
1105
2138
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1106
2139
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -1117,6 +2150,65 @@ var Subscription = /** @class */ (function () {
1117
2150
  if (utils.matchContentType(contentType, "application/json")) {
1118
2151
  res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1119
2152
  }
2153
+ else {
2154
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2155
+ }
2156
+ break;
2157
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
2158
+ if (utils.matchContentType(contentType, "application/json")) {
2159
+ res.fourHundredError = JSON.parse(decodedRes);
2160
+ }
2161
+ else {
2162
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2163
+ }
2164
+ break;
2165
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
2166
+ if (utils.matchContentType(contentType, "application/json")) {
2167
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
2168
+ }
2169
+ else {
2170
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2171
+ }
2172
+ break;
2173
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
2174
+ if (utils.matchContentType(contentType, "application/json")) {
2175
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
2176
+ }
2177
+ else {
2178
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2179
+ }
2180
+ break;
2181
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
2182
+ if (utils.matchContentType(contentType, "application/json")) {
2183
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
2184
+ }
2185
+ else {
2186
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2187
+ }
2188
+ break;
2189
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
2190
+ if (utils.matchContentType(contentType, "application/json")) {
2191
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
2192
+ }
2193
+ else {
2194
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2195
+ }
2196
+ break;
2197
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
2198
+ if (utils.matchContentType(contentType, "application/json")) {
2199
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
2200
+ }
2201
+ else {
2202
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2203
+ }
2204
+ break;
2205
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
2206
+ if (utils.matchContentType(contentType, "application/json")) {
2207
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
2208
+ }
2209
+ else {
2210
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2211
+ }
1120
2212
  break;
1121
2213
  }
1122
2214
  return [2 /*return*/, res];
@@ -1130,16 +2222,20 @@ var Subscription = /** @class */ (function () {
1130
2222
  * @remarks
1131
2223
  * This endpoint can be used to update the quantity for a fixed fee.
1132
2224
  *
1133
- * To be eligible, the subscription must currently be active and the price specified must be a fixed fee (not usage-based). This operation will immediately update the quantity for the fee, or if a `effective_date` is passed in, will update the quantity on the requested date at midnight in the customer's timezone.
2225
+ * To be eligible, the subscription must currently be active and the price specified must be a fixed fee (not
2226
+ * usage-based). This operation will immediately update the quantity for the fee, or if a `effective_date` is passed
2227
+ * in, will update the quantity on the requested date at midnight in the customer's timezone.
1134
2228
  *
1135
- * In order to change the fixed fee quantity as of the next draft invoice for this subscription, pass `change_option=upcoming_invoice` without an `effective_date` specified.
2229
+ * In order to change the fixed fee quantity as of the next draft invoice for this subscription, pass
2230
+ * `change_option=upcoming_invoice` without an `effective_date` specified.
1136
2231
  *
1137
- * If the fee is an in-advance fixed fee, it will also issue an immediate invoice for the difference for the remainder of the billing period.
2232
+ * If the fee is an in-advance fixed fee, it will also issue an immediate invoice for the difference for the remainder
2233
+ * of the billing period.
1138
2234
  */
1139
2235
  Subscription.prototype.updateFixedFeeQuantity = function (req, config) {
1140
2236
  var _a, _b;
1141
2237
  return __awaiter(this, void 0, void 0, function () {
1142
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
2238
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
1143
2239
  var _d;
1144
2240
  return __generator(this, function (_e) {
1145
2241
  switch (_e.label) {
@@ -1149,7 +2245,7 @@ var Subscription = /** @class */ (function () {
1149
2245
  }
1150
2246
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1151
2247
  url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/update_fixed_fee_quantity", req);
1152
- _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
2248
+ _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1153
2249
  try {
1154
2250
  _d = __read(utils.serializeRequestBody(req, "fixedFeeQuantityChange", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1155
2251
  }
@@ -1158,12 +2254,23 @@ var Subscription = /** @class */ (function () {
1158
2254
  throw new Error("Error serializing request body, cause: ".concat(e.message));
1159
2255
  }
1160
2256
  }
1161
- client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient;
1162
- headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
2257
+ client = this.sdkConfiguration.defaultClient;
2258
+ globalSecurity = this.sdkConfiguration.security;
2259
+ if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
2260
+ return [4 /*yield*/, globalSecurity()];
2261
+ case 1:
2262
+ globalSecurity = _e.sent();
2263
+ _e.label = 2;
2264
+ case 2:
2265
+ if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
2266
+ globalSecurity = new shared.Security(globalSecurity);
2267
+ }
2268
+ properties = utils.parseSecurityProperties(globalSecurity);
2269
+ headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1163
2270
  headers["Accept"] = "application/json";
1164
- headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
2271
+ headers["user-agent"] = this.sdkConfiguration.userAgent;
1165
2272
  return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1166
- case 1:
2273
+ case 3:
1167
2274
  httpRes = _e.sent();
1168
2275
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
1169
2276
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
@@ -1180,6 +2287,65 @@ var Subscription = /** @class */ (function () {
1180
2287
  if (utils.matchContentType(contentType, "application/json")) {
1181
2288
  res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1182
2289
  }
2290
+ else {
2291
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2292
+ }
2293
+ break;
2294
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
2295
+ if (utils.matchContentType(contentType, "application/json")) {
2296
+ res.fourHundredError = JSON.parse(decodedRes);
2297
+ }
2298
+ else {
2299
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2300
+ }
2301
+ break;
2302
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
2303
+ if (utils.matchContentType(contentType, "application/json")) {
2304
+ res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
2305
+ }
2306
+ else {
2307
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2308
+ }
2309
+ break;
2310
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
2311
+ if (utils.matchContentType(contentType, "application/json")) {
2312
+ res.fourHundredAndFourError = JSON.parse(decodedRes);
2313
+ }
2314
+ else {
2315
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2316
+ }
2317
+ break;
2318
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
2319
+ if (utils.matchContentType(contentType, "application/json")) {
2320
+ res.fourHundredAndNineError = JSON.parse(decodedRes);
2321
+ }
2322
+ else {
2323
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2324
+ }
2325
+ break;
2326
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
2327
+ if (utils.matchContentType(contentType, "application/json")) {
2328
+ res.fourHundredAndThirteenError = JSON.parse(decodedRes);
2329
+ }
2330
+ else {
2331
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2332
+ }
2333
+ break;
2334
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
2335
+ if (utils.matchContentType(contentType, "application/json")) {
2336
+ res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
2337
+ }
2338
+ else {
2339
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2340
+ }
2341
+ break;
2342
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
2343
+ if (utils.matchContentType(contentType, "application/json")) {
2344
+ res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
2345
+ }
2346
+ else {
2347
+ throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2348
+ }
1183
2349
  break;
1184
2350
  }
1185
2351
  return [2 /*return*/, res];