orb-billing 1.21.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1115) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE +201 -0
  3. package/README.md +196 -192
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +90 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +239 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +830 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +799 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +131 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +298 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +271 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +210 -0
  87. package/index.d.ts +210 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +153 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +125 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +90 -27
  94. package/pagination.d.ts +31 -0
  95. package/pagination.d.ts.map +1 -0
  96. package/pagination.js +34 -0
  97. package/pagination.js.map +1 -0
  98. package/pagination.mjs +30 -0
  99. package/pagination.mjs.map +1 -0
  100. package/resource.d.ts +12 -0
  101. package/resource.d.ts.map +1 -0
  102. package/resource.js +17 -0
  103. package/resource.js.map +1 -0
  104. package/resource.mjs +13 -0
  105. package/resource.mjs.map +1 -0
  106. package/resources/coupons/coupons.d.ts +114 -0
  107. package/resources/coupons/coupons.d.ts.map +1 -0
  108. package/resources/coupons/coupons.js +76 -0
  109. package/resources/coupons/coupons.js.map +1 -0
  110. package/resources/coupons/coupons.mjs +48 -0
  111. package/resources/coupons/coupons.mjs.map +1 -0
  112. package/resources/coupons/index.d.ts +3 -0
  113. package/resources/coupons/index.d.ts.map +1 -0
  114. package/resources/coupons/index.js +10 -0
  115. package/resources/coupons/index.js.map +1 -0
  116. package/resources/coupons/index.mjs +4 -0
  117. package/resources/coupons/index.mjs.map +1 -0
  118. package/resources/coupons/subscriptions.d.ts +23 -0
  119. package/resources/coupons/subscriptions.d.ts.map +1 -0
  120. package/resources/coupons/subscriptions.js +20 -0
  121. package/resources/coupons/subscriptions.js.map +1 -0
  122. package/resources/coupons/subscriptions.mjs +16 -0
  123. package/resources/coupons/subscriptions.mjs.map +1 -0
  124. package/resources/credit-notes.d.ts +136 -0
  125. package/resources/credit-notes.d.ts.map +1 -0
  126. package/resources/credit-notes.js +54 -0
  127. package/resources/credit-notes.js.map +1 -0
  128. package/resources/credit-notes.mjs +26 -0
  129. package/resources/credit-notes.mjs.map +1 -0
  130. package/resources/customers/balance-transactions.d.ts +159 -0
  131. package/resources/customers/balance-transactions.d.ts.map +1 -0
  132. package/resources/customers/balance-transactions.js +54 -0
  133. package/resources/customers/balance-transactions.js.map +1 -0
  134. package/resources/customers/balance-transactions.mjs +26 -0
  135. package/resources/customers/balance-transactions.mjs.map +1 -0
  136. package/resources/customers/costs.d.ts +915 -0
  137. package/resources/customers/costs.d.ts.map +1 -0
  138. package/resources/customers/costs.js +24 -0
  139. package/resources/customers/costs.js.map +1 -0
  140. package/resources/customers/costs.mjs +20 -0
  141. package/resources/customers/costs.mjs.map +1 -0
  142. package/resources/customers/credits/credits.d.ts +58 -0
  143. package/resources/customers/credits/credits.d.ts.map +1 -0
  144. package/resources/customers/credits/credits.js +68 -0
  145. package/resources/customers/credits/credits.js.map +1 -0
  146. package/resources/customers/credits/credits.mjs +39 -0
  147. package/resources/customers/credits/credits.mjs.map +1 -0
  148. package/resources/customers/credits/index.d.ts +3 -0
  149. package/resources/customers/credits/index.d.ts.map +1 -0
  150. package/resources/customers/credits/index.js +13 -0
  151. package/resources/customers/credits/index.js.map +1 -0
  152. package/resources/customers/credits/index.mjs +4 -0
  153. package/resources/customers/credits/index.mjs.map +1 -0
  154. package/resources/customers/credits/ledger.d.ts +1537 -0
  155. package/resources/customers/credits/ledger.d.ts.map +1 -0
  156. package/resources/customers/credits/ledger.js +291 -0
  157. package/resources/customers/credits/ledger.js.map +1 -0
  158. package/resources/customers/credits/ledger.mjs +262 -0
  159. package/resources/customers/credits/ledger.mjs.map +1 -0
  160. package/resources/customers/customers.d.ts +524 -0
  161. package/resources/customers/customers.d.ts.map +1 -0
  162. package/resources/customers/customers.js +135 -0
  163. package/resources/customers/customers.js.map +1 -0
  164. package/resources/customers/customers.mjs +107 -0
  165. package/resources/customers/customers.mjs.map +1 -0
  166. package/resources/customers/index.d.ts +6 -0
  167. package/resources/customers/index.d.ts.map +1 -0
  168. package/resources/customers/index.js +19 -0
  169. package/resources/customers/index.js.map +1 -0
  170. package/resources/customers/index.mjs +7 -0
  171. package/resources/customers/index.mjs.map +1 -0
  172. package/resources/customers/usage.d.ts +306 -0
  173. package/resources/customers/usage.d.ts.map +1 -0
  174. package/resources/customers/usage.js +223 -0
  175. package/resources/customers/usage.js.map +1 -0
  176. package/resources/customers/usage.mjs +219 -0
  177. package/resources/customers/usage.mjs.map +1 -0
  178. package/resources/events/backfills.d.ts +250 -0
  179. package/resources/events/backfills.d.ts.map +1 -0
  180. package/resources/events/backfills.js +104 -0
  181. package/resources/events/backfills.js.map +1 -0
  182. package/resources/events/backfills.mjs +76 -0
  183. package/resources/events/backfills.mjs.map +1 -0
  184. package/resources/events/events.d.ts +547 -0
  185. package/resources/events/events.d.ts.map +1 -0
  186. package/resources/events/events.js +354 -0
  187. package/resources/events/events.js.map +1 -0
  188. package/resources/events/events.mjs +327 -0
  189. package/resources/events/events.mjs.map +1 -0
  190. package/resources/events/index.d.ts +3 -0
  191. package/resources/events/index.d.ts.map +1 -0
  192. package/resources/events/index.js +10 -0
  193. package/resources/events/index.js.map +1 -0
  194. package/resources/events/index.mjs +4 -0
  195. package/resources/events/index.mjs.map +1 -0
  196. package/resources/index.d.ts +13 -0
  197. package/resources/index.d.ts.map +1 -0
  198. package/resources/index.js +39 -0
  199. package/resources/index.js.map +1 -0
  200. package/resources/index.mjs +14 -0
  201. package/resources/index.mjs.map +1 -0
  202. package/resources/invoice-line-items.d.ts +434 -0
  203. package/resources/invoice-line-items.d.ts.map +1 -0
  204. package/resources/invoice-line-items.js +18 -0
  205. package/resources/invoice-line-items.js.map +1 -0
  206. package/resources/invoice-line-items.mjs +14 -0
  207. package/resources/invoice-line-items.mjs.map +1 -0
  208. package/resources/invoices.d.ts +1541 -0
  209. package/resources/invoices.d.ts.map +1 -0
  210. package/resources/invoices.js +96 -0
  211. package/resources/invoices.js.map +1 -0
  212. package/resources/invoices.mjs +68 -0
  213. package/resources/invoices.mjs.map +1 -0
  214. package/resources/items.d.ts +61 -0
  215. package/resources/items.d.ts.map +1 -0
  216. package/resources/items.js +53 -0
  217. package/resources/items.js.map +1 -0
  218. package/resources/items.mjs +25 -0
  219. package/resources/items.mjs.map +1 -0
  220. package/resources/metrics.d.ts +176 -0
  221. package/resources/metrics.d.ts.map +1 -0
  222. package/resources/metrics.js +63 -0
  223. package/resources/metrics.js.map +1 -0
  224. package/resources/metrics.mjs +35 -0
  225. package/resources/metrics.mjs.map +1 -0
  226. package/resources/plans/external-plan-id.d.ts +50 -0
  227. package/resources/plans/external-plan-id.d.ts.map +1 -0
  228. package/resources/plans/external-plan-id.js +35 -0
  229. package/resources/plans/external-plan-id.js.map +1 -0
  230. package/resources/plans/external-plan-id.mjs +31 -0
  231. package/resources/plans/external-plan-id.mjs.map +1 -0
  232. package/resources/plans/index.d.ts +3 -0
  233. package/resources/plans/index.d.ts.map +1 -0
  234. package/resources/plans/index.js +10 -0
  235. package/resources/plans/index.js.map +1 -0
  236. package/resources/plans/index.mjs +4 -0
  237. package/resources/plans/index.mjs.map +1 -0
  238. package/resources/plans/plans.d.ts +256 -0
  239. package/resources/plans/plans.d.ts.map +1 -0
  240. package/resources/plans/plans.js +87 -0
  241. package/resources/plans/plans.js.map +1 -0
  242. package/resources/plans/plans.mjs +59 -0
  243. package/resources/plans/plans.mjs.map +1 -0
  244. package/resources/prices/external-price-id.d.ts +12 -0
  245. package/resources/prices/external-price-id.d.ts.map +1 -0
  246. package/resources/prices/external-price-id.js +17 -0
  247. package/resources/prices/external-price-id.js.map +1 -0
  248. package/resources/prices/external-price-id.mjs +13 -0
  249. package/resources/prices/external-price-id.mjs.map +1 -0
  250. package/resources/prices/index.d.ts +3 -0
  251. package/resources/prices/index.d.ts.map +1 -0
  252. package/resources/prices/index.js +10 -0
  253. package/resources/prices/index.js.map +1 -0
  254. package/resources/prices/index.mjs +4 -0
  255. package/resources/prices/index.mjs.map +1 -0
  256. package/resources/prices/prices.d.ts +1872 -0
  257. package/resources/prices/prices.d.ts.map +1 -0
  258. package/resources/prices/prices.js +74 -0
  259. package/resources/prices/prices.js.map +1 -0
  260. package/resources/prices/prices.mjs +46 -0
  261. package/resources/prices/prices.mjs.map +1 -0
  262. package/resources/subscriptions.d.ts +3752 -0
  263. package/resources/subscriptions.d.ts.map +1 -0
  264. package/resources/subscriptions.js +254 -0
  265. package/resources/subscriptions.js.map +1 -0
  266. package/resources/subscriptions.mjs +225 -0
  267. package/resources/subscriptions.mjs.map +1 -0
  268. package/resources/top-level.d.ts +21 -0
  269. package/resources/top-level.d.ts.map +1 -0
  270. package/resources/top-level.js +22 -0
  271. package/resources/top-level.js.map +1 -0
  272. package/resources/top-level.mjs +18 -0
  273. package/resources/top-level.mjs.map +1 -0
  274. package/shims/node.d.ts +29 -0
  275. package/shims/node.d.ts.map +1 -0
  276. package/shims/node.js +31 -0
  277. package/shims/node.js.map +1 -0
  278. package/shims/node.mjs +5 -0
  279. package/shims/node.mjs.map +1 -0
  280. package/shims/web.d.ts +26 -0
  281. package/shims/web.d.ts.map +1 -0
  282. package/shims/web.js +31 -0
  283. package/shims/web.js.map +1 -0
  284. package/shims/web.mjs +5 -0
  285. package/shims/web.mjs.map +1 -0
  286. package/src/_shims/MultipartBody.ts +9 -0
  287. package/src/_shims/README.md +46 -0
  288. package/src/_shims/auto/runtime-bun.ts +4 -0
  289. package/src/_shims/auto/runtime-node.ts +4 -0
  290. package/src/_shims/auto/runtime.ts +4 -0
  291. package/src/_shims/auto/types-node.ts +4 -0
  292. package/src/_shims/auto/types.d.ts +101 -0
  293. package/src/_shims/auto/types.js +3 -0
  294. package/src/_shims/auto/types.mjs +3 -0
  295. package/src/_shims/bun-runtime.ts +14 -0
  296. package/src/_shims/index.d.ts +81 -0
  297. package/src/_shims/index.js +13 -0
  298. package/src/_shims/index.mjs +7 -0
  299. package/src/_shims/manual-types.d.ts +12 -0
  300. package/src/_shims/manual-types.js +3 -0
  301. package/src/_shims/manual-types.mjs +3 -0
  302. package/src/_shims/node-runtime.ts +83 -0
  303. package/src/_shims/node-types.d.ts +42 -0
  304. package/src/_shims/node-types.js +3 -0
  305. package/src/_shims/node-types.mjs +3 -0
  306. package/src/_shims/registry.ts +67 -0
  307. package/src/_shims/web-runtime.ts +103 -0
  308. package/src/_shims/web-types.d.ts +83 -0
  309. package/src/_shims/web-types.js +3 -0
  310. package/src/_shims/web-types.mjs +3 -0
  311. package/src/core.ts +1099 -0
  312. package/src/error.ts +469 -0
  313. package/src/index.ts +305 -0
  314. package/src/pagination.ts +63 -0
  315. package/src/resource.ts +24 -0
  316. package/src/resources/coupons/coupons.ts +150 -0
  317. package/src/resources/coupons/index.ts +4 -0
  318. package/src/resources/coupons/subscriptions.ts +45 -0
  319. package/src/resources/credit-notes.ts +184 -0
  320. package/src/resources/customers/balance-transactions.ts +222 -0
  321. package/src/resources/customers/costs.ts +991 -0
  322. package/src/resources/customers/credits/credits.ts +113 -0
  323. package/src/resources/customers/credits/index.ts +24 -0
  324. package/src/resources/customers/credits/ledger.ts +2254 -0
  325. package/src/resources/customers/customers.ts +734 -0
  326. package/src/resources/customers/index.ts +42 -0
  327. package/src/resources/customers/usage.ts +350 -0
  328. package/src/resources/events/backfills.ts +324 -0
  329. package/src/resources/events/events.ts +635 -0
  330. package/src/resources/events/index.ts +23 -0
  331. package/src/resources/index.ts +72 -0
  332. package/src/resources/invoice-line-items.ts +502 -0
  333. package/src/resources/invoices.ts +1906 -0
  334. package/src/resources/items.ts +106 -0
  335. package/src/resources/metrics.ts +264 -0
  336. package/src/resources/plans/external-plan-id.ts +73 -0
  337. package/src/resources/plans/index.ts +4 -0
  338. package/src/resources/plans/plans.ts +350 -0
  339. package/src/resources/prices/external-price-id.ts +16 -0
  340. package/src/resources/prices/index.ts +4 -0
  341. package/src/resources/prices/prices.ts +2466 -0
  342. package/src/resources/subscriptions.ts +4590 -0
  343. package/src/resources/top-level.ts +27 -0
  344. package/src/shims/node.ts +50 -0
  345. package/src/shims/web.ts +50 -0
  346. package/src/tsconfig.json +11 -0
  347. package/src/uploads.ts +246 -0
  348. package/src/version.ts +1 -0
  349. package/uploads.d.ts +75 -0
  350. package/uploads.d.ts.map +1 -0
  351. package/uploads.js +162 -0
  352. package/uploads.js.map +1 -0
  353. package/uploads.mjs +149 -0
  354. package/uploads.mjs.map +1 -0
  355. package/version.d.ts +2 -0
  356. package/version.d.ts.map +1 -0
  357. package/version.js +5 -0
  358. package/version.js.map +1 -0
  359. package/version.mjs +2 -0
  360. package/version.mjs.map +1 -0
  361. package/LICENSE.md +0 -21
  362. package/dist/index.d.ts +0 -1
  363. package/dist/index.js +0 -20
  364. package/dist/internal/utils/contenttype.d.ts +0 -1
  365. package/dist/internal/utils/contenttype.js +0 -33
  366. package/dist/internal/utils/headers.d.ts +0 -4
  367. package/dist/internal/utils/headers.js +0 -92
  368. package/dist/internal/utils/index.d.ts +0 -8
  369. package/dist/internal/utils/index.js +0 -27
  370. package/dist/internal/utils/pathparams.d.ts +0 -2
  371. package/dist/internal/utils/pathparams.js +0 -53
  372. package/dist/internal/utils/queryparams.d.ts +0 -2
  373. package/dist/internal/utils/queryparams.js +0 -178
  374. package/dist/internal/utils/requestbody.d.ts +0 -2
  375. package/dist/internal/utils/requestbody.js +0 -318
  376. package/dist/internal/utils/retries.d.ts +0 -20
  377. package/dist/internal/utils/retries.js +0 -250
  378. package/dist/internal/utils/security.d.ts +0 -5
  379. package/dist/internal/utils/security.js +0 -188
  380. package/dist/internal/utils/utils.d.ts +0 -37
  381. package/dist/internal/utils/utils.js +0 -370
  382. package/dist/sdk/availability.d.ts +0 -18
  383. package/dist/sdk/availability.js +0 -186
  384. package/dist/sdk/coupon.d.ts +0 -62
  385. package/dist/sdk/coupon.js +0 -629
  386. package/dist/sdk/credit.d.ts +0 -348
  387. package/dist/sdk/credit.js +0 -1020
  388. package/dist/sdk/creditnote.d.ts +0 -29
  389. package/dist/sdk/creditnote.js +0 -293
  390. package/dist/sdk/customer.d.ts +0 -529
  391. package/dist/sdk/customer.js +0 -1882
  392. package/dist/sdk/event.d.ts +0 -353
  393. package/dist/sdk/event.js +0 -1314
  394. package/dist/sdk/index.d.ts +0 -1
  395. package/dist/sdk/index.js +0 -20
  396. package/dist/sdk/invoice.d.ts +0 -89
  397. package/dist/sdk/invoice.js +0 -945
  398. package/dist/sdk/item.d.ts +0 -27
  399. package/dist/sdk/item.js +0 -291
  400. package/dist/sdk/metric.d.ts +0 -39
  401. package/dist/sdk/metric.js +0 -418
  402. package/dist/sdk/models/errors/fivehundrederror.d.ts +0 -11
  403. package/dist/sdk/models/errors/fivehundrederror.js +0 -88
  404. package/dist/sdk/models/errors/fourhundredandoneerror.d.ts +0 -11
  405. package/dist/sdk/models/errors/fourhundredandoneerror.js +0 -88
  406. package/dist/sdk/models/errors/fourhundredandtwentynineerror.d.ts +0 -11
  407. package/dist/sdk/models/errors/fourhundredandtwentynineerror.js +0 -88
  408. package/dist/sdk/models/errors/index.d.ts +0 -4
  409. package/dist/sdk/models/errors/index.js +0 -23
  410. package/dist/sdk/models/errors/sdkerror.d.ts +0 -7
  411. package/dist/sdk/models/errors/sdkerror.js +0 -40
  412. package/dist/sdk/models/operations/addeditpriceintervals.d.ts +0 -25
  413. package/dist/sdk/models/operations/addeditpriceintervals.js +0 -95
  414. package/dist/sdk/models/operations/amendevent.d.ts +0 -25
  415. package/dist/sdk/models/operations/amendevent.js +0 -95
  416. package/dist/sdk/models/operations/amendusage.d.ts +0 -27
  417. package/dist/sdk/models/operations/amendusage.js +0 -103
  418. package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +0 -27
  419. package/dist/sdk/models/operations/amendusageexternalcustomerid.js +0 -103
  420. package/dist/sdk/models/operations/archivecoupon.d.ts +0 -24
  421. package/dist/sdk/models/operations/archivecoupon.js +0 -91
  422. package/dist/sdk/models/operations/cancelsubscription.d.ts +0 -25
  423. package/dist/sdk/models/operations/cancelsubscription.js +0 -95
  424. package/dist/sdk/models/operations/closebackfill.d.ts +0 -24
  425. package/dist/sdk/models/operations/closebackfill.js +0 -91
  426. package/dist/sdk/models/operations/createbackfill.d.ts +0 -21
  427. package/dist/sdk/models/operations/createbackfill.js +0 -79
  428. package/dist/sdk/models/operations/createcoupon.d.ts +0 -21
  429. package/dist/sdk/models/operations/createcoupon.js +0 -79
  430. package/dist/sdk/models/operations/createcustomer.d.ts +0 -21
  431. package/dist/sdk/models/operations/createcustomer.js +0 -79
  432. package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +0 -25
  433. package/dist/sdk/models/operations/createcustomerbalancetransaction.js +0 -95
  434. package/dist/sdk/models/operations/createinvoice.d.ts +0 -21
  435. package/dist/sdk/models/operations/createinvoice.js +0 -79
  436. package/dist/sdk/models/operations/createinvoicelineitem.d.ts +0 -21
  437. package/dist/sdk/models/operations/createinvoicelineitem.js +0 -79
  438. package/dist/sdk/models/operations/createledgerentry.d.ts +0 -24
  439. package/dist/sdk/models/operations/createledgerentry.js +0 -71
  440. package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +0 -24
  441. package/dist/sdk/models/operations/createledgerentryexternalid.js +0 -71
  442. package/dist/sdk/models/operations/createmetric.d.ts +0 -21
  443. package/dist/sdk/models/operations/createmetric.js +0 -79
  444. package/dist/sdk/models/operations/createplan.d.ts +0 -21
  445. package/dist/sdk/models/operations/createplan.js +0 -79
  446. package/dist/sdk/models/operations/createprice.d.ts +0 -20
  447. package/dist/sdk/models/operations/createprice.js +0 -55
  448. package/dist/sdk/models/operations/createsubscription.d.ts +0 -21
  449. package/dist/sdk/models/operations/createsubscription.js +0 -79
  450. package/dist/sdk/models/operations/deletecustomer.d.ts +0 -24
  451. package/dist/sdk/models/operations/deletecustomer.js +0 -91
  452. package/dist/sdk/models/operations/deprecateevent.d.ts +0 -24
  453. package/dist/sdk/models/operations/deprecateevent.js +0 -91
  454. package/dist/sdk/models/operations/fetchbackfill.d.ts +0 -24
  455. package/dist/sdk/models/operations/fetchbackfill.js +0 -91
  456. package/dist/sdk/models/operations/fetchcoupon.d.ts +0 -24
  457. package/dist/sdk/models/operations/fetchcoupon.js +0 -91
  458. package/dist/sdk/models/operations/fetchcreditnote.d.ts +0 -24
  459. package/dist/sdk/models/operations/fetchcreditnote.js +0 -91
  460. package/dist/sdk/models/operations/fetchcustomer.d.ts +0 -24
  461. package/dist/sdk/models/operations/fetchcustomer.js +0 -91
  462. package/dist/sdk/models/operations/fetchcustomercosts.d.ts +0 -38
  463. package/dist/sdk/models/operations/fetchcustomercosts.js +0 -115
  464. package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +0 -38
  465. package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +0 -115
  466. package/dist/sdk/models/operations/fetchcustomercredits.d.ts +0 -26
  467. package/dist/sdk/models/operations/fetchcustomercredits.js +0 -99
  468. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +0 -26
  469. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +0 -99
  470. package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +0 -47
  471. package/dist/sdk/models/operations/fetchcustomercreditsledger.js +0 -146
  472. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +0 -47
  473. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +0 -146
  474. package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +0 -24
  475. package/dist/sdk/models/operations/fetchcustomerexternalid.js +0 -91
  476. package/dist/sdk/models/operations/fetchinvoice.d.ts +0 -24
  477. package/dist/sdk/models/operations/fetchinvoice.js +0 -91
  478. package/dist/sdk/models/operations/fetchitem.d.ts +0 -24
  479. package/dist/sdk/models/operations/fetchitem.js +0 -91
  480. package/dist/sdk/models/operations/fetchmetric.d.ts +0 -24
  481. package/dist/sdk/models/operations/fetchmetric.js +0 -91
  482. package/dist/sdk/models/operations/fetchplan.d.ts +0 -24
  483. package/dist/sdk/models/operations/fetchplan.js +0 -91
  484. package/dist/sdk/models/operations/fetchplanexternalid.d.ts +0 -24
  485. package/dist/sdk/models/operations/fetchplanexternalid.js +0 -91
  486. package/dist/sdk/models/operations/fetchprice.d.ts +0 -23
  487. package/dist/sdk/models/operations/fetchprice.js +0 -67
  488. package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +0 -23
  489. package/dist/sdk/models/operations/fetchpriceexternalid.js +0 -67
  490. package/dist/sdk/models/operations/fetchsubscription.d.ts +0 -24
  491. package/dist/sdk/models/operations/fetchsubscription.js +0 -91
  492. package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +0 -38
  493. package/dist/sdk/models/operations/fetchsubscriptioncosts.js +0 -115
  494. package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +0 -30
  495. package/dist/sdk/models/operations/fetchsubscriptionschedule.js +0 -115
  496. package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +0 -54
  497. package/dist/sdk/models/operations/fetchsubscriptionusage.js +0 -130
  498. package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +0 -24
  499. package/dist/sdk/models/operations/fetchupcominginvoice.js +0 -91
  500. package/dist/sdk/models/operations/index.d.ts +0 -73
  501. package/dist/sdk/models/operations/index.js +0 -92
  502. package/dist/sdk/models/operations/ingest.d.ts +0 -26
  503. package/dist/sdk/models/operations/ingest.js +0 -99
  504. package/dist/sdk/models/operations/issueinvoice.d.ts +0 -24
  505. package/dist/sdk/models/operations/issueinvoice.js +0 -91
  506. package/dist/sdk/models/operations/listbackfills.d.ts +0 -25
  507. package/dist/sdk/models/operations/listbackfills.js +0 -95
  508. package/dist/sdk/models/operations/listbalancetransactions.d.ts +0 -30
  509. package/dist/sdk/models/operations/listbalancetransactions.js +0 -115
  510. package/dist/sdk/models/operations/listcoupons.d.ts +0 -27
  511. package/dist/sdk/models/operations/listcoupons.js +0 -103
  512. package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +0 -26
  513. package/dist/sdk/models/operations/listcouponsubscriptions.js +0 -99
  514. package/dist/sdk/models/operations/listcreditnotes.d.ts +0 -25
  515. package/dist/sdk/models/operations/listcreditnotes.js +0 -95
  516. package/dist/sdk/models/operations/listcustomers.d.ts +0 -29
  517. package/dist/sdk/models/operations/listcustomers.js +0 -111
  518. package/dist/sdk/models/operations/listinvoices.d.ts +0 -62
  519. package/dist/sdk/models/operations/listinvoices.js +0 -189
  520. package/dist/sdk/models/operations/listitems.d.ts +0 -25
  521. package/dist/sdk/models/operations/listitems.js +0 -95
  522. package/dist/sdk/models/operations/listmetrics.d.ts +0 -29
  523. package/dist/sdk/models/operations/listmetrics.js +0 -111
  524. package/dist/sdk/models/operations/listplans.d.ts +0 -41
  525. package/dist/sdk/models/operations/listplans.js +0 -124
  526. package/dist/sdk/models/operations/listprices.d.ts +0 -25
  527. package/dist/sdk/models/operations/listprices.js +0 -95
  528. package/dist/sdk/models/operations/listsubscriptions.d.ts +0 -37
  529. package/dist/sdk/models/operations/listsubscriptions.js +0 -129
  530. package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +0 -25
  531. package/dist/sdk/models/operations/markinvoiceaspaid.js +0 -95
  532. package/dist/sdk/models/operations/ping.d.ts +0 -21
  533. package/dist/sdk/models/operations/ping.js +0 -79
  534. package/dist/sdk/models/operations/revertbackfill.d.ts +0 -24
  535. package/dist/sdk/models/operations/revertbackfill.js +0 -91
  536. package/dist/sdk/models/operations/scheduleplanchange.d.ts +0 -25
  537. package/dist/sdk/models/operations/scheduleplanchange.js +0 -95
  538. package/dist/sdk/models/operations/searchevents.d.ts +0 -30
  539. package/dist/sdk/models/operations/searchevents.js +0 -115
  540. package/dist/sdk/models/operations/triggerphase.d.ts +0 -25
  541. package/dist/sdk/models/operations/triggerphase.js +0 -95
  542. package/dist/sdk/models/operations/unschedulecancellation.d.ts +0 -24
  543. package/dist/sdk/models/operations/unschedulecancellation.js +0 -91
  544. package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +0 -25
  545. package/dist/sdk/models/operations/unschedulefixedfeequantity.js +0 -95
  546. package/dist/sdk/models/operations/unscheduleplanchange.d.ts +0 -24
  547. package/dist/sdk/models/operations/unscheduleplanchange.js +0 -91
  548. package/dist/sdk/models/operations/updatecustomer.d.ts +0 -25
  549. package/dist/sdk/models/operations/updatecustomer.js +0 -95
  550. package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +0 -25
  551. package/dist/sdk/models/operations/updatecustomerexternalid.js +0 -95
  552. package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +0 -25
  553. package/dist/sdk/models/operations/updatefixedfeequantity.js +0 -95
  554. package/dist/sdk/models/operations/updateplan.d.ts +0 -25
  555. package/dist/sdk/models/operations/updateplan.js +0 -95
  556. package/dist/sdk/models/operations/updateplanexternal.d.ts +0 -25
  557. package/dist/sdk/models/operations/updateplanexternal.js +0 -95
  558. package/dist/sdk/models/operations/voidinvoice.d.ts +0 -24
  559. package/dist/sdk/models/operations/voidinvoice.js +0 -91
  560. package/dist/sdk/models/shared/accountingprovider.d.ts +0 -9
  561. package/dist/sdk/models/shared/accountingprovider.js +0 -55
  562. package/dist/sdk/models/shared/accountingproviderconfig.d.ts +0 -5
  563. package/dist/sdk/models/shared/accountingproviderconfig.js +0 -50
  564. package/dist/sdk/models/shared/accountingsyncconfiguration.d.ts +0 -6
  565. package/dist/sdk/models/shared/accountingsyncconfiguration.js +0 -52
  566. package/dist/sdk/models/shared/addeditpriceintervalparams.d.ts +0 -13
  567. package/dist/sdk/models/shared/addeditpriceintervalparams.js +0 -54
  568. package/dist/sdk/models/shared/addpriceintervalparams.d.ts +0 -40
  569. package/dist/sdk/models/shared/addpriceintervalparams.js +0 -87
  570. package/dist/sdk/models/shared/address.d.ts +0 -9
  571. package/dist/sdk/models/shared/address.js +0 -70
  572. package/dist/sdk/models/shared/addressinput.d.ts +0 -9
  573. package/dist/sdk/models/shared/addressinput.js +0 -70
  574. package/dist/sdk/models/shared/aggregatedcost.d.ts +0 -15
  575. package/dist/sdk/models/shared/aggregatedcost.js +0 -75
  576. package/dist/sdk/models/shared/amendedevent.d.ts +0 -28
  577. package/dist/sdk/models/shared/amendedevent.js +0 -81
  578. package/dist/sdk/models/shared/amendedusage.d.ts +0 -11
  579. package/dist/sdk/models/shared/amendedusage.js +0 -50
  580. package/dist/sdk/models/shared/amendeventresult.d.ts +0 -7
  581. package/dist/sdk/models/shared/amendeventresult.js +0 -45
  582. package/dist/sdk/models/shared/autocollection.d.ts +0 -15
  583. package/dist/sdk/models/shared/autocollection.js +0 -63
  584. package/dist/sdk/models/shared/backfill.d.ts +0 -27
  585. package/dist/sdk/models/shared/backfill.js +0 -104
  586. package/dist/sdk/models/shared/backfills.d.ts +0 -7
  587. package/dist/sdk/models/shared/backfills.js +0 -54
  588. package/dist/sdk/models/shared/backfillstatus.d.ts +0 -9
  589. package/dist/sdk/models/shared/backfillstatus.js +0 -16
  590. package/dist/sdk/models/shared/billablemetric.d.ts +0 -27
  591. package/dist/sdk/models/shared/billablemetric.js +0 -84
  592. package/dist/sdk/models/shared/billablemetrics.d.ts +0 -7
  593. package/dist/sdk/models/shared/billablemetrics.js +0 -54
  594. package/dist/sdk/models/shared/billingcyclealignment.d.ts +0 -8
  595. package/dist/sdk/models/shared/billingcyclealignment.js +0 -15
  596. package/dist/sdk/models/shared/cancelsubscriptionparams.d.ts +0 -19
  597. package/dist/sdk/models/shared/cancelsubscriptionparams.js +0 -63
  598. package/dist/sdk/models/shared/changeoption.d.ts +0 -5
  599. package/dist/sdk/models/shared/changeoption.js +0 -12
  600. package/dist/sdk/models/shared/coupon.d.ts +0 -40
  601. package/dist/sdk/models/shared/coupon.js +0 -98
  602. package/dist/sdk/models/shared/couponredemption.d.ts +0 -6
  603. package/dist/sdk/models/shared/couponredemption.js +0 -63
  604. package/dist/sdk/models/shared/coupons.d.ts +0 -7
  605. package/dist/sdk/models/shared/coupons.js +0 -54
  606. package/dist/sdk/models/shared/createinvoicelineitemparams.d.ts +0 -28
  607. package/dist/sdk/models/shared/createinvoicelineitemparams.js +0 -81
  608. package/dist/sdk/models/shared/createoneoffinvoiceparams.d.ts +0 -33
  609. package/dist/sdk/models/shared/createoneoffinvoiceparams.js +0 -86
  610. package/dist/sdk/models/shared/creditledgerentries.d.ts +0 -6
  611. package/dist/sdk/models/shared/creditledgerentries.js +0 -52
  612. package/dist/sdk/models/shared/creditnote.d.ts +0 -83
  613. package/dist/sdk/models/shared/creditnote.js +0 -171
  614. package/dist/sdk/models/shared/creditnotelineitem.d.ts +0 -40
  615. package/dist/sdk/models/shared/creditnotelineitem.js +0 -100
  616. package/dist/sdk/models/shared/creditnoteminified.d.ts +0 -7
  617. package/dist/sdk/models/shared/creditnoteminified.js +0 -45
  618. package/dist/sdk/models/shared/creditnotes.d.ts +0 -7
  619. package/dist/sdk/models/shared/creditnotes.js +0 -54
  620. package/dist/sdk/models/shared/creditnotesublineitem.d.ts +0 -6
  621. package/dist/sdk/models/shared/creditnotesublineitem.js +0 -55
  622. package/dist/sdk/models/shared/creditnotesummary.d.ts +0 -12
  623. package/dist/sdk/models/shared/creditnotesummary.js +0 -74
  624. package/dist/sdk/models/shared/customer.d.ts +0 -76
  625. package/dist/sdk/models/shared/customer.js +0 -182
  626. package/dist/sdk/models/shared/customerbalancetransaction.d.ts +0 -42
  627. package/dist/sdk/models/shared/customerbalancetransaction.js +0 -109
  628. package/dist/sdk/models/shared/customerbalancetransactions.d.ts +0 -7
  629. package/dist/sdk/models/shared/customerbalancetransactions.js +0 -54
  630. package/dist/sdk/models/shared/customercosts.d.ts +0 -5
  631. package/dist/sdk/models/shared/customercosts.js +0 -47
  632. package/dist/sdk/models/shared/customercreditbalance.d.ts +0 -7
  633. package/dist/sdk/models/shared/customercreditbalance.js +0 -64
  634. package/dist/sdk/models/shared/customercreditbalances.d.ts +0 -7
  635. package/dist/sdk/models/shared/customercreditbalances.js +0 -54
  636. package/dist/sdk/models/shared/customerminified.d.ts +0 -5
  637. package/dist/sdk/models/shared/customerminified.js +0 -50
  638. package/dist/sdk/models/shared/customers.d.ts +0 -7
  639. package/dist/sdk/models/shared/customers.js +0 -54
  640. package/dist/sdk/models/shared/customertaxid.d.ts +0 -6
  641. package/dist/sdk/models/shared/customertaxid.js +0 -55
  642. package/dist/sdk/models/shared/debug.d.ts +0 -8
  643. package/dist/sdk/models/shared/debug.js +0 -53
  644. package/dist/sdk/models/shared/deletecustomerresponse.d.ts +0 -3
  645. package/dist/sdk/models/shared/deletecustomerresponse.js +0 -30
  646. package/dist/sdk/models/shared/deprecatedeventresult.d.ts +0 -7
  647. package/dist/sdk/models/shared/deprecatedeventresult.js +0 -45
  648. package/dist/sdk/models/shared/discount.d.ts +0 -33
  649. package/dist/sdk/models/shared/discount.js +0 -80
  650. package/dist/sdk/models/shared/editcustomer.d.ts +0 -72
  651. package/dist/sdk/models/shared/editcustomer.js +0 -151
  652. package/dist/sdk/models/shared/editplan.d.ts +0 -10
  653. package/dist/sdk/models/shared/editplan.js +0 -59
  654. package/dist/sdk/models/shared/editpriceintervalparams.d.ts +0 -20
  655. package/dist/sdk/models/shared/editpriceintervalparams.js +0 -62
  656. package/dist/sdk/models/shared/event.d.ts +0 -39
  657. package/dist/sdk/models/shared/event.js +0 -93
  658. package/dist/sdk/models/shared/events.d.ts +0 -7
  659. package/dist/sdk/models/shared/events.js +0 -54
  660. package/dist/sdk/models/shared/eventsearchcriteria.d.ts +0 -11
  661. package/dist/sdk/models/shared/eventsearchcriteria.js +0 -50
  662. package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +0 -25
  663. package/dist/sdk/models/shared/fixedfeequantitychange.js +0 -75
  664. package/dist/sdk/models/shared/fixedfeequantityscheduleentry.d.ts +0 -7
  665. package/dist/sdk/models/shared/fixedfeequantityscheduleentry.js +0 -68
  666. package/dist/sdk/models/shared/fixedfeequantitytransition.d.ts +0 -6
  667. package/dist/sdk/models/shared/fixedfeequantitytransition.js +0 -59
  668. package/dist/sdk/models/shared/index.d.ts +0 -109
  669. package/dist/sdk/models/shared/index.js +0 -128
  670. package/dist/sdk/models/shared/ingestevent.d.ts +0 -32
  671. package/dist/sdk/models/shared/ingestevent.js +0 -86
  672. package/dist/sdk/models/shared/ingestionresponse.d.ts +0 -13
  673. package/dist/sdk/models/shared/ingestionresponse.js +0 -54
  674. package/dist/sdk/models/shared/ingestrequestbody.d.ts +0 -5
  675. package/dist/sdk/models/shared/ingestrequestbody.js +0 -47
  676. package/dist/sdk/models/shared/invoice.d.ts +0 -138
  677. package/dist/sdk/models/shared/invoice.js +0 -329
  678. package/dist/sdk/models/shared/invoicelineitem.d.ts +0 -49
  679. package/dist/sdk/models/shared/invoicelineitem.js +0 -134
  680. package/dist/sdk/models/shared/invoicelineitemparams.d.ts +0 -26
  681. package/dist/sdk/models/shared/invoicelineitemparams.js +0 -90
  682. package/dist/sdk/models/shared/invoiceminified.d.ts +0 -7
  683. package/dist/sdk/models/shared/invoiceminified.js +0 -45
  684. package/dist/sdk/models/shared/invoices.d.ts +0 -7
  685. package/dist/sdk/models/shared/invoices.js +0 -54
  686. package/dist/sdk/models/shared/item.d.ts +0 -14
  687. package/dist/sdk/models/shared/item.js +0 -72
  688. package/dist/sdk/models/shared/itemexternalconnection.d.ts +0 -5
  689. package/dist/sdk/models/shared/itemexternalconnection.js +0 -50
  690. package/dist/sdk/models/shared/items.d.ts +0 -7
  691. package/dist/sdk/models/shared/items.js +0 -54
  692. package/dist/sdk/models/shared/markaspaidrequestparams.d.ts +0 -16
  693. package/dist/sdk/models/shared/markaspaidrequestparams.js +0 -61
  694. package/dist/sdk/models/shared/maximum.d.ts +0 -11
  695. package/dist/sdk/models/shared/maximum.js +0 -50
  696. package/dist/sdk/models/shared/maximuminterval.d.ts +0 -23
  697. package/dist/sdk/models/shared/maximuminterval.js +0 -73
  698. package/dist/sdk/models/shared/minimum.d.ts +0 -11
  699. package/dist/sdk/models/shared/minimum.js +0 -50
  700. package/dist/sdk/models/shared/minimuminterval.d.ts +0 -23
  701. package/dist/sdk/models/shared/minimuminterval.js +0 -73
  702. package/dist/sdk/models/shared/newaccountingsyncconfiguration.d.ts +0 -6
  703. package/dist/sdk/models/shared/newaccountingsyncconfiguration.js +0 -52
  704. package/dist/sdk/models/shared/newbackfill.d.ts +0 -27
  705. package/dist/sdk/models/shared/newbackfill.js +0 -82
  706. package/dist/sdk/models/shared/newbillablemetric.d.ts +0 -28
  707. package/dist/sdk/models/shared/newbillablemetric.js +0 -77
  708. package/dist/sdk/models/shared/newcoupon.d.ts +0 -18
  709. package/dist/sdk/models/shared/newcoupon.js +0 -69
  710. package/dist/sdk/models/shared/newcustomer.d.ts +0 -68
  711. package/dist/sdk/models/shared/newcustomer.js +0 -152
  712. package/dist/sdk/models/shared/newcustomerbalancetransaction.d.ts +0 -13
  713. package/dist/sdk/models/shared/newcustomerbalancetransaction.js +0 -60
  714. package/dist/sdk/models/shared/newplan.d.ts +0 -26
  715. package/dist/sdk/models/shared/newplan.js +0 -93
  716. package/dist/sdk/models/shared/newreportingconfiguration.d.ts +0 -4
  717. package/dist/sdk/models/shared/newreportingconfiguration.js +0 -45
  718. package/dist/sdk/models/shared/newsubscription.d.ts +0 -54
  719. package/dist/sdk/models/shared/newsubscription.js +0 -187
  720. package/dist/sdk/models/shared/paginationmetadata.d.ts +0 -5
  721. package/dist/sdk/models/shared/paginationmetadata.js +0 -50
  722. package/dist/sdk/models/shared/perpricecost.d.ts +0 -224
  723. package/dist/sdk/models/shared/perpricecost.js +0 -67
  724. package/dist/sdk/models/shared/phaseoverride.d.ts +0 -17
  725. package/dist/sdk/models/shared/phaseoverride.js +0 -62
  726. package/dist/sdk/models/shared/pingresponse.d.ts +0 -4
  727. package/dist/sdk/models/shared/pingresponse.js +0 -45
  728. package/dist/sdk/models/shared/plan.d.ts +0 -66
  729. package/dist/sdk/models/shared/plan.js +0 -188
  730. package/dist/sdk/models/shared/planminified.d.ts +0 -9
  731. package/dist/sdk/models/shared/planminified.js +0 -55
  732. package/dist/sdk/models/shared/planphase.d.ts +0 -28
  733. package/dist/sdk/models/shared/planphase.js +0 -106
  734. package/dist/sdk/models/shared/plans.d.ts +0 -7
  735. package/dist/sdk/models/shared/plans.js +0 -54
  736. package/dist/sdk/models/shared/pricegroup.d.ts +0 -17
  737. package/dist/sdk/models/shared/pricegroup.js +0 -65
  738. package/dist/sdk/models/shared/priceinterval.d.ts +0 -239
  739. package/dist/sdk/models/shared/priceinterval.js +0 -104
  740. package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.d.ts +0 -11
  741. package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.js +0 -54
  742. package/dist/sdk/models/shared/prices.d.ts +0 -6
  743. package/dist/sdk/models/shared/prices.js +0 -52
  744. package/dist/sdk/models/shared/product.d.ts +0 -6
  745. package/dist/sdk/models/shared/product.js +0 -59
  746. package/dist/sdk/models/shared/reportingconfiguration.d.ts +0 -4
  747. package/dist/sdk/models/shared/reportingconfiguration.js +0 -45
  748. package/dist/sdk/models/shared/security.d.ts +0 -4
  749. package/dist/sdk/models/shared/security.js +0 -45
  750. package/dist/sdk/models/shared/subscription.d.ts +0 -128
  751. package/dist/sdk/models/shared/subscription.js +0 -226
  752. package/dist/sdk/models/shared/subscriptioncosts.d.ts +0 -5
  753. package/dist/sdk/models/shared/subscriptioncosts.js +0 -47
  754. package/dist/sdk/models/shared/subscriptionminified.d.ts +0 -4
  755. package/dist/sdk/models/shared/subscriptionminified.js +0 -45
  756. package/dist/sdk/models/shared/subscriptionplanchange.d.ts +0 -59
  757. package/dist/sdk/models/shared/subscriptionplanchange.js +0 -126
  758. package/dist/sdk/models/shared/subscriptions.d.ts +0 -7
  759. package/dist/sdk/models/shared/subscriptions.js +0 -54
  760. package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +0 -7
  761. package/dist/sdk/models/shared/subscriptionscheduleitem.js +0 -65
  762. package/dist/sdk/models/shared/subscriptionscheduleitems.d.ts +0 -7
  763. package/dist/sdk/models/shared/subscriptionscheduleitems.js +0 -54
  764. package/dist/sdk/models/shared/subscriptiontrialinfo.d.ts +0 -4
  765. package/dist/sdk/models/shared/subscriptiontrialinfo.js +0 -49
  766. package/dist/sdk/models/shared/taxamount.d.ts +0 -15
  767. package/dist/sdk/models/shared/taxamount.js +0 -55
  768. package/dist/sdk/models/shared/trialconfig.d.ts +0 -8
  769. package/dist/sdk/models/shared/trialconfig.js +0 -54
  770. package/dist/sdk/models/shared/triggersubscriptionphaseparams.d.ts +0 -8
  771. package/dist/sdk/models/shared/triggersubscriptionphaseparams.js +0 -51
  772. package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.d.ts +0 -7
  773. package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.js +0 -45
  774. package/dist/sdk/models/shared/upcominginvoice.d.ts +0 -130
  775. package/dist/sdk/models/shared/upcominginvoice.js +0 -321
  776. package/dist/sdk/models/shared/updateevent.d.ts +0 -28
  777. package/dist/sdk/models/shared/updateevent.js +0 -81
  778. package/dist/sdk/models/shared/validationerror.d.ts +0 -11
  779. package/dist/sdk/models/shared/validationerror.js +0 -50
  780. package/dist/sdk/plan.d.ts +0 -90
  781. package/dist/sdk/plan.js +0 -764
  782. package/dist/sdk/price.d.ts +0 -246
  783. package/dist/sdk/price.js +0 -715
  784. package/dist/sdk/priceinterval.d.ts +0 -66
  785. package/dist/sdk/priceinterval.js +0 -263
  786. package/dist/sdk/sdk.d.ts +0 -389
  787. package/dist/sdk/sdk.js +0 -93
  788. package/dist/sdk/subscription.d.ts +0 -769
  789. package/dist/sdk/subscription.js +0 -2116
  790. package/dist/sdk/types/index.d.ts +0 -1
  791. package/dist/sdk/types/index.js +0 -20
  792. package/dist/sdk/types/rfcdate.d.ts +0 -9
  793. package/dist/sdk/types/rfcdate.js +0 -59
  794. package/docs/models/errors/fivehundrederror.md +0 -12
  795. package/docs/models/errors/fivehundrederrorheaders.md +0 -7
  796. package/docs/models/errors/fourhundredandoneerror.md +0 -12
  797. package/docs/models/errors/fourhundredandoneerrorheaders.md +0 -7
  798. package/docs/models/errors/fourhundredandtwentynineerror.md +0 -12
  799. package/docs/models/errors/fourhundredandtwentynineerrorheaders.md +0 -7
  800. package/docs/models/operations/addeditpriceintervalsrequest.md +0 -9
  801. package/docs/models/operations/addeditpriceintervalsresponse.md +0 -11
  802. package/docs/models/operations/amendeventrequest.md +0 -9
  803. package/docs/models/operations/amendeventresponse.md +0 -11
  804. package/docs/models/operations/amendusageexternalcustomeridrequest.md +0 -11
  805. package/docs/models/operations/amendusageexternalcustomeridresponse.md +0 -11
  806. package/docs/models/operations/amendusagerequest.md +0 -11
  807. package/docs/models/operations/amendusageresponse.md +0 -11
  808. package/docs/models/operations/archivecouponrequest.md +0 -8
  809. package/docs/models/operations/archivecouponresponse.md +0 -11
  810. package/docs/models/operations/cancelsubscriptionrequest.md +0 -9
  811. package/docs/models/operations/cancelsubscriptionresponse.md +0 -11
  812. package/docs/models/operations/closebackfillrequest.md +0 -8
  813. package/docs/models/operations/closebackfillresponse.md +0 -11
  814. package/docs/models/operations/createbackfillresponse.md +0 -11
  815. package/docs/models/operations/createcouponresponse.md +0 -11
  816. package/docs/models/operations/createcustomerbalancetransactionrequest.md +0 -9
  817. package/docs/models/operations/createcustomerbalancetransactionresponse.md +0 -11
  818. package/docs/models/operations/createcustomerresponse.md +0 -11
  819. package/docs/models/operations/createinvoicelineitemresponse.md +0 -11
  820. package/docs/models/operations/createinvoiceresponse.md +0 -11
  821. package/docs/models/operations/createledgerentryexternalidrequest.md +0 -9
  822. package/docs/models/operations/createledgerentryexternalidresponse.md +0 -11
  823. package/docs/models/operations/createledgerentryrequest.md +0 -9
  824. package/docs/models/operations/createledgerentryresponse.md +0 -11
  825. package/docs/models/operations/createmetricresponse.md +0 -11
  826. package/docs/models/operations/createplanresponse.md +0 -11
  827. package/docs/models/operations/createpriceresponse.md +0 -11
  828. package/docs/models/operations/createsubscriptionresponse.md +0 -11
  829. package/docs/models/operations/deletecustomerrequest.md +0 -8
  830. package/docs/models/operations/deletecustomerresponse.md +0 -11
  831. package/docs/models/operations/deprecateeventrequest.md +0 -8
  832. package/docs/models/operations/deprecateeventresponse.md +0 -11
  833. package/docs/models/operations/fetchbackfillrequest.md +0 -8
  834. package/docs/models/operations/fetchbackfillresponse.md +0 -11
  835. package/docs/models/operations/fetchcouponrequest.md +0 -8
  836. package/docs/models/operations/fetchcouponresponse.md +0 -11
  837. package/docs/models/operations/fetchcreditnoterequest.md +0 -8
  838. package/docs/models/operations/fetchcreditnoteresponse.md +0 -11
  839. package/docs/models/operations/fetchcustomercostsexternalidrequest.md +0 -12
  840. package/docs/models/operations/fetchcustomercostsexternalidresponse.md +0 -11
  841. package/docs/models/operations/fetchcustomercostsexternalidviewmodeviewmode.md +0 -11
  842. package/docs/models/operations/fetchcustomercostsrequest.md +0 -12
  843. package/docs/models/operations/fetchcustomercostsresponse.md +0 -11
  844. package/docs/models/operations/fetchcustomercostsviewmodeviewmode.md +0 -11
  845. package/docs/models/operations/fetchcustomercreditsexternalidrequest.md +0 -10
  846. package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +0 -11
  847. package/docs/models/operations/fetchcustomercreditsledgerentrystatusentrystatus.md +0 -9
  848. package/docs/models/operations/fetchcustomercreditsledgerentrytypeentrytype.md +0 -14
  849. package/docs/models/operations/fetchcustomercreditsledgerexternalidentrystatusentrystatus.md +0 -9
  850. package/docs/models/operations/fetchcustomercreditsledgerexternalidentrytypeentrytype.md +0 -14
  851. package/docs/models/operations/fetchcustomercreditsledgerexternalidrequest.md +0 -18
  852. package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +0 -11
  853. package/docs/models/operations/fetchcustomercreditsledgerrequest.md +0 -18
  854. package/docs/models/operations/fetchcustomercreditsledgerresponse.md +0 -11
  855. package/docs/models/operations/fetchcustomercreditsrequest.md +0 -10
  856. package/docs/models/operations/fetchcustomercreditsresponse.md +0 -11
  857. package/docs/models/operations/fetchcustomerexternalidrequest.md +0 -8
  858. package/docs/models/operations/fetchcustomerexternalidresponse.md +0 -11
  859. package/docs/models/operations/fetchcustomerrequest.md +0 -8
  860. package/docs/models/operations/fetchcustomerresponse.md +0 -11
  861. package/docs/models/operations/fetchinvoicerequest.md +0 -8
  862. package/docs/models/operations/fetchinvoiceresponse.md +0 -11
  863. package/docs/models/operations/fetchitemrequest.md +0 -8
  864. package/docs/models/operations/fetchitemresponse.md +0 -11
  865. package/docs/models/operations/fetchmetricrequest.md +0 -8
  866. package/docs/models/operations/fetchmetricresponse.md +0 -11
  867. package/docs/models/operations/fetchplanexternalidrequest.md +0 -8
  868. package/docs/models/operations/fetchplanexternalidresponse.md +0 -11
  869. package/docs/models/operations/fetchplanrequest.md +0 -8
  870. package/docs/models/operations/fetchplanresponse.md +0 -11
  871. package/docs/models/operations/fetchpriceexternalidrequest.md +0 -8
  872. package/docs/models/operations/fetchpriceexternalidresponse.md +0 -11
  873. package/docs/models/operations/fetchpricerequest.md +0 -8
  874. package/docs/models/operations/fetchpriceresponse.md +0 -11
  875. package/docs/models/operations/fetchsubscriptioncostsrequest.md +0 -12
  876. package/docs/models/operations/fetchsubscriptioncostsresponse.md +0 -11
  877. package/docs/models/operations/fetchsubscriptioncostsviewmodeviewmode.md +0 -11
  878. package/docs/models/operations/fetchsubscriptionrequest.md +0 -8
  879. package/docs/models/operations/fetchsubscriptionresponse.md +0 -11
  880. package/docs/models/operations/fetchsubscriptionschedulerequest.md +0 -14
  881. package/docs/models/operations/fetchsubscriptionscheduleresponse.md +0 -11
  882. package/docs/models/operations/fetchsubscriptionusagegranularitygranularity.md +0 -10
  883. package/docs/models/operations/fetchsubscriptionusagerequest.md +0 -20
  884. package/docs/models/operations/fetchsubscriptionusageresponse.md +0 -11
  885. package/docs/models/operations/fetchsubscriptionusageviewmodeviewmode.md +0 -11
  886. package/docs/models/operations/fetchupcominginvoicerequest.md +0 -8
  887. package/docs/models/operations/fetchupcominginvoiceresponse.md +0 -11
  888. package/docs/models/operations/ingestrequest.md +0 -10
  889. package/docs/models/operations/ingestresponse.md +0 -11
  890. package/docs/models/operations/issueinvoicerequest.md +0 -8
  891. package/docs/models/operations/issueinvoiceresponse.md +0 -11
  892. package/docs/models/operations/listbackfillsrequest.md +0 -9
  893. package/docs/models/operations/listbackfillsresponse.md +0 -11
  894. package/docs/models/operations/listbalancetransactionsrequest.md +0 -14
  895. package/docs/models/operations/listbalancetransactionsresponse.md +0 -11
  896. package/docs/models/operations/listcouponsrequest.md +0 -11
  897. package/docs/models/operations/listcouponsresponse.md +0 -11
  898. package/docs/models/operations/listcouponsubscriptionsrequest.md +0 -10
  899. package/docs/models/operations/listcouponsubscriptionsresponse.md +0 -11
  900. package/docs/models/operations/listcreditnotesrequest.md +0 -9
  901. package/docs/models/operations/listcreditnotesresponse.md +0 -11
  902. package/docs/models/operations/listcustomersrequest.md +0 -13
  903. package/docs/models/operations/listcustomersresponse.md +0 -11
  904. package/docs/models/operations/listinvoicesdatetypedatetype.md +0 -9
  905. package/docs/models/operations/listinvoicesrequest.md +0 -27
  906. package/docs/models/operations/listinvoicesresponse.md +0 -11
  907. package/docs/models/operations/listinvoicesstatus.md +0 -12
  908. package/docs/models/operations/listinvoicesstatusstatus.md +0 -12
  909. package/docs/models/operations/listitemsrequest.md +0 -9
  910. package/docs/models/operations/listitemsresponse.md +0 -11
  911. package/docs/models/operations/listmetricsrequest.md +0 -13
  912. package/docs/models/operations/listmetricsresponse.md +0 -11
  913. package/docs/models/operations/listplansrequest.md +0 -14
  914. package/docs/models/operations/listplansresponse.md +0 -11
  915. package/docs/models/operations/listplansstatusstatus.md +0 -12
  916. package/docs/models/operations/listpricesrequest.md +0 -9
  917. package/docs/models/operations/listpricesresponse.md +0 -11
  918. package/docs/models/operations/listsubscriptionsrequest.md +0 -16
  919. package/docs/models/operations/listsubscriptionsresponse.md +0 -11
  920. package/docs/models/operations/listsubscriptionsstatusstatus.md +0 -10
  921. package/docs/models/operations/markinvoiceaspaidrequest.md +0 -9
  922. package/docs/models/operations/markinvoiceaspaidresponse.md +0 -11
  923. package/docs/models/operations/pingresponse.md +0 -11
  924. package/docs/models/operations/revertbackfillrequest.md +0 -8
  925. package/docs/models/operations/revertbackfillresponse.md +0 -11
  926. package/docs/models/operations/scheduleplanchangerequest.md +0 -9
  927. package/docs/models/operations/scheduleplanchangeresponse.md +0 -11
  928. package/docs/models/operations/searcheventsrequest.md +0 -14
  929. package/docs/models/operations/searcheventsresponse.md +0 -11
  930. package/docs/models/operations/triggerphaserequest.md +0 -9
  931. package/docs/models/operations/triggerphaseresponse.md +0 -11
  932. package/docs/models/operations/unschedulecancellationrequest.md +0 -8
  933. package/docs/models/operations/unschedulecancellationresponse.md +0 -11
  934. package/docs/models/operations/unschedulefixedfeequantityrequest.md +0 -9
  935. package/docs/models/operations/unschedulefixedfeequantityresponse.md +0 -11
  936. package/docs/models/operations/unscheduleplanchangerequest.md +0 -8
  937. package/docs/models/operations/unscheduleplanchangeresponse.md +0 -11
  938. package/docs/models/operations/updatecustomerexternalidrequest.md +0 -9
  939. package/docs/models/operations/updatecustomerexternalidresponse.md +0 -11
  940. package/docs/models/operations/updatecustomerrequest.md +0 -9
  941. package/docs/models/operations/updatecustomerresponse.md +0 -11
  942. package/docs/models/operations/updatefixedfeequantityrequest.md +0 -9
  943. package/docs/models/operations/updatefixedfeequantityresponse.md +0 -11
  944. package/docs/models/operations/updateplanexternalrequest.md +0 -9
  945. package/docs/models/operations/updateplanexternalresponse.md +0 -11
  946. package/docs/models/operations/updateplanrequest.md +0 -9
  947. package/docs/models/operations/updateplanresponse.md +0 -11
  948. package/docs/models/operations/voidinvoicerequest.md +0 -8
  949. package/docs/models/operations/voidinvoiceresponse.md +0 -11
  950. package/docs/models/shared/accountingprovider.md +0 -9
  951. package/docs/models/shared/accountingproviderconfig.md +0 -9
  952. package/docs/models/shared/accountingproviderprovidertype.md +0 -9
  953. package/docs/models/shared/accountingsyncconfiguration.md +0 -9
  954. package/docs/models/shared/addeditpriceintervalparams.md +0 -9
  955. package/docs/models/shared/addpriceintervalparams.md +0 -16
  956. package/docs/models/shared/address.md +0 -13
  957. package/docs/models/shared/addressinput.md +0 -13
  958. package/docs/models/shared/aggregatedcost.md +0 -12
  959. package/docs/models/shared/amendedevent.md +0 -12
  960. package/docs/models/shared/amendedeventproperties.md +0 -9
  961. package/docs/models/shared/amendedusage.md +0 -9
  962. package/docs/models/shared/amendeventresult.md +0 -8
  963. package/docs/models/shared/autocollection.md +0 -10
  964. package/docs/models/shared/backfill.md +0 -17
  965. package/docs/models/shared/backfills.md +0 -9
  966. package/docs/models/shared/backfillstatus.md +0 -13
  967. package/docs/models/shared/billablemetric.md +0 -16
  968. package/docs/models/shared/billablemetrics.md +0 -9
  969. package/docs/models/shared/billablemetricstatus.md +0 -10
  970. package/docs/models/shared/billingcyclealignment.md +0 -12
  971. package/docs/models/shared/cancelsubscriptionparams.md +0 -9
  972. package/docs/models/shared/cancelsubscriptionparamscanceloption.md +0 -12
  973. package/docs/models/shared/changeoption.md +0 -10
  974. package/docs/models/shared/coupon.md +0 -21
  975. package/docs/models/shared/coupondiscount.md +0 -7
  976. package/docs/models/shared/couponredemption.md +0 -10
  977. package/docs/models/shared/coupons.md +0 -9
  978. package/docs/models/shared/createinvoicelineitemparams.md +0 -13
  979. package/docs/models/shared/createoneoffinvoiceparams.md +0 -15
  980. package/docs/models/shared/creditledgerentries.md +0 -9
  981. package/docs/models/shared/creditnote.md +0 -26
  982. package/docs/models/shared/creditnotediscounts.md +0 -7
  983. package/docs/models/shared/creditnotelineitem.md +0 -15
  984. package/docs/models/shared/creditnotelineitemdiscounts.md +0 -7
  985. package/docs/models/shared/creditnotelineitemtaxamounts.md +0 -7
  986. package/docs/models/shared/creditnotemaximumamountadjustment.md +0 -9
  987. package/docs/models/shared/creditnoteminified.md +0 -8
  988. package/docs/models/shared/creditnotereason.md +0 -11
  989. package/docs/models/shared/creditnotes.md +0 -9
  990. package/docs/models/shared/creditnotesublineitem.md +0 -10
  991. package/docs/models/shared/creditnotesummary.md +0 -13
  992. package/docs/models/shared/creditnotetype.md +0 -9
  993. package/docs/models/shared/customer.md +0 -42
  994. package/docs/models/shared/customerbalancetransaction.md +0 -17
  995. package/docs/models/shared/customerbalancetransactionaction.md +0 -10
  996. package/docs/models/shared/customerbalancetransactions.md +0 -9
  997. package/docs/models/shared/customerbalancetransactiontype.md +0 -9
  998. package/docs/models/shared/customercosts.md +0 -8
  999. package/docs/models/shared/customercreditbalance.md +0 -11
  1000. package/docs/models/shared/customercreditbalances.md +0 -9
  1001. package/docs/models/shared/customerminified.md +0 -9
  1002. package/docs/models/shared/customerpaymentprovider.md +0 -14
  1003. package/docs/models/shared/customers.md +0 -9
  1004. package/docs/models/shared/customertaxid.md +0 -10
  1005. package/docs/models/shared/debug.md +0 -11
  1006. package/docs/models/shared/deletecustomerresponse.md +0 -7
  1007. package/docs/models/shared/deprecatedeventresult.md +0 -8
  1008. package/docs/models/shared/discount.md +0 -15
  1009. package/docs/models/shared/discountdiscounttype.md +0 -11
  1010. package/docs/models/shared/editcustomer.md +0 -22
  1011. package/docs/models/shared/editcustomermetadata.md +0 -9
  1012. package/docs/models/shared/editcustomerpaymentprovider.md +0 -16
  1013. package/docs/models/shared/editplan.md +0 -9
  1014. package/docs/models/shared/editplanmetadata.md +0 -7
  1015. package/docs/models/shared/editpriceintervalparams.md +0 -11
  1016. package/docs/models/shared/event.md +0 -17
  1017. package/docs/models/shared/eventproperties.md +0 -9
  1018. package/docs/models/shared/events.md +0 -9
  1019. package/docs/models/shared/eventsearchcriteria.md +0 -9
  1020. package/docs/models/shared/fixedfeequantitychange.md +0 -11
  1021. package/docs/models/shared/fixedfeequantitychangechangeoption.md +0 -12
  1022. package/docs/models/shared/fixedfeequantityscheduleentry.md +0 -11
  1023. package/docs/models/shared/fixedfeequantitytransition.md +0 -10
  1024. package/docs/models/shared/ingestevent.md +0 -13
  1025. package/docs/models/shared/ingesteventproperties.md +0 -9
  1026. package/docs/models/shared/ingestionresponse.md +0 -9
  1027. package/docs/models/shared/ingestrequestbody.md +0 -8
  1028. package/docs/models/shared/invoice.md +0 -51
  1029. package/docs/models/shared/invoicelineitem.md +0 -23
  1030. package/docs/models/shared/invoicelineitemparams.md +0 -14
  1031. package/docs/models/shared/invoicelineitemparamsmodeltype.md +0 -8
  1032. package/docs/models/shared/invoicemetadata.md +0 -7
  1033. package/docs/models/shared/invoiceminified.md +0 -8
  1034. package/docs/models/shared/invoices.md +0 -9
  1035. package/docs/models/shared/invoicestatus.md +0 -12
  1036. package/docs/models/shared/item.md +0 -14
  1037. package/docs/models/shared/itemexternalconnection.md +0 -9
  1038. package/docs/models/shared/items.md +0 -9
  1039. package/docs/models/shared/markaspaidrequestparams.md +0 -10
  1040. package/docs/models/shared/maximum.md +0 -9
  1041. package/docs/models/shared/maximuminterval.md +0 -12
  1042. package/docs/models/shared/minimum.md +0 -9
  1043. package/docs/models/shared/minimuminterval.md +0 -12
  1044. package/docs/models/shared/newaccountingsyncconfiguration.md +0 -9
  1045. package/docs/models/shared/newbackfill.md +0 -13
  1046. package/docs/models/shared/newbillablemetric.md +0 -12
  1047. package/docs/models/shared/newbillablemetricmetadata.md +0 -9
  1048. package/docs/models/shared/newcoupon.md +0 -11
  1049. package/docs/models/shared/newcoupondiscount.md +0 -7
  1050. package/docs/models/shared/newcustomer.md +0 -23
  1051. package/docs/models/shared/newcustomerbalancetransaction.md +0 -10
  1052. package/docs/models/shared/newcustomerbalancetransactiontype.md +0 -9
  1053. package/docs/models/shared/newcustomermetadata.md +0 -9
  1054. package/docs/models/shared/newcustomerpaymentprovider.md +0 -14
  1055. package/docs/models/shared/newplan.md +0 -14
  1056. package/docs/models/shared/newplanmetadata.md +0 -7
  1057. package/docs/models/shared/newplanprices.md +0 -7
  1058. package/docs/models/shared/newreportingconfiguration.md +0 -8
  1059. package/docs/models/shared/newsubscription.md +0 -31
  1060. package/docs/models/shared/newsubscriptionexternalmarketplace.md +0 -10
  1061. package/docs/models/shared/newsubscriptionmetadata.md +0 -7
  1062. package/docs/models/shared/paginationmetadata.md +0 -9
  1063. package/docs/models/shared/perpricecost.md +0 -12
  1064. package/docs/models/shared/phaseoverride.md +0 -11
  1065. package/docs/models/shared/pingresponse.md +0 -8
  1066. package/docs/models/shared/plan.md +0 -33
  1067. package/docs/models/shared/planmetadata.md +0 -7
  1068. package/docs/models/shared/planminified.md +0 -10
  1069. package/docs/models/shared/planphase.md +0 -18
  1070. package/docs/models/shared/planphasedurationunit.md +0 -11
  1071. package/docs/models/shared/plans.md +0 -9
  1072. package/docs/models/shared/planstatus.md +0 -10
  1073. package/docs/models/shared/pricegroup.md +0 -12
  1074. package/docs/models/shared/priceinterval.md +0 -18
  1075. package/docs/models/shared/priceintervalfixedfeequantitytransitionparams.md +0 -9
  1076. package/docs/models/shared/prices.md +0 -9
  1077. package/docs/models/shared/product.md +0 -10
  1078. package/docs/models/shared/reportingconfiguration.md +0 -8
  1079. package/docs/models/shared/security.md +0 -8
  1080. package/docs/models/shared/subscription.md +0 -44
  1081. package/docs/models/shared/subscriptioncosts.md +0 -8
  1082. package/docs/models/shared/subscriptionmetadata.md +0 -9
  1083. package/docs/models/shared/subscriptionminified.md +0 -8
  1084. package/docs/models/shared/subscriptionplanchange.md +0 -23
  1085. package/docs/models/shared/subscriptions.md +0 -9
  1086. package/docs/models/shared/subscriptionscheduleitem.md +0 -10
  1087. package/docs/models/shared/subscriptionscheduleitems.md +0 -9
  1088. package/docs/models/shared/subscriptionstatus.md +0 -10
  1089. package/docs/models/shared/subscriptiontrialinfo.md +0 -8
  1090. package/docs/models/shared/taxamount.md +0 -10
  1091. package/docs/models/shared/trialconfig.md +0 -9
  1092. package/docs/models/shared/trialconfigtrialperiodunit.md +0 -8
  1093. package/docs/models/shared/triggersubscriptionphaseparams.md +0 -8
  1094. package/docs/models/shared/unschedulefixedfeequantitychangeparams.md +0 -8
  1095. package/docs/models/shared/upcominginvoice.md +0 -46
  1096. package/docs/models/shared/upcominginvoicemetadata.md +0 -7
  1097. package/docs/models/shared/upcominginvoicestatus.md +0 -12
  1098. package/docs/models/shared/updateevent.md +0 -12
  1099. package/docs/models/shared/updateeventproperties.md +0 -9
  1100. package/docs/models/shared/validationerror.md +0 -9
  1101. package/docs/sdks/availability/README.md +0 -46
  1102. package/docs/sdks/coupon/README.md +0 -235
  1103. package/docs/sdks/credit/README.md +0 -565
  1104. package/docs/sdks/creditnote/README.md +0 -94
  1105. package/docs/sdks/customer/README.md +0 -1080
  1106. package/docs/sdks/event/README.md +0 -674
  1107. package/docs/sdks/invoice/README.md +0 -388
  1108. package/docs/sdks/item/README.md +0 -92
  1109. package/docs/sdks/metric/README.md +0 -136
  1110. package/docs/sdks/orb/README.md +0 -21
  1111. package/docs/sdks/plan/README.md +0 -298
  1112. package/docs/sdks/price/README.md +0 -375
  1113. package/docs/sdks/priceinterval/README.md +0 -137
  1114. package/docs/sdks/subscription/README.md +0 -1306
  1115. package/docs/types/rfcdate.md +0 -11
@@ -1,2116 +0,0 @@
1
- "use strict";
2
- /*
3
- * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
- */
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- var desc = Object.getOwnPropertyDescriptor(m, k);
19
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
- desc = { enumerable: true, get: function() { return m[k]; } };
21
- }
22
- Object.defineProperty(o, k2, desc);
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
- Object.defineProperty(o, "default", { enumerable: true, value: v });
29
- }) : function(o, v) {
30
- o["default"] = v;
31
- });
32
- var __importStar = (this && this.__importStar) || function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
40
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
41
- return new (P || (P = Promise))(function (resolve, reject) {
42
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
43
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
44
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
45
- step((generator = generator.apply(thisArg, _arguments || [])).next());
46
- });
47
- };
48
- var __generator = (this && this.__generator) || function (thisArg, body) {
49
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
50
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
- function verb(n) { return function (v) { return step([n, v]); }; }
52
- function step(op) {
53
- if (f) throw new TypeError("Generator is already executing.");
54
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
55
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
56
- if (y = 0, t) op = [op[0] & 2, t.value];
57
- switch (op[0]) {
58
- case 0: case 1: t = op; break;
59
- case 4: _.label++; return { value: op[1], done: false };
60
- case 5: _.label++; y = op[1]; op = [0]; continue;
61
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
62
- default:
63
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
64
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
65
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
66
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
67
- if (t[2]) _.ops.pop();
68
- _.trys.pop(); continue;
69
- }
70
- op = body.call(thisArg, _);
71
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
72
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
- }
74
- };
75
- var __read = (this && this.__read) || function (o, n) {
76
- var m = typeof Symbol === "function" && o[Symbol.iterator];
77
- if (!m) return o;
78
- var i = m.call(o), r, ar = [], e;
79
- try {
80
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
81
- }
82
- catch (error) { e = { error: error }; }
83
- finally {
84
- try {
85
- if (r && !r.done && (m = i["return"])) m.call(i);
86
- }
87
- finally { if (e) throw e.error; }
88
- }
89
- return ar;
90
- };
91
- Object.defineProperty(exports, "__esModule", { value: true });
92
- exports.Subscription = void 0;
93
- var utils = __importStar(require("../internal/utils"));
94
- var errors = __importStar(require("./models/errors"));
95
- var operations = __importStar(require("./models/operations"));
96
- var shared = __importStar(require("./models/shared"));
97
- /**
98
- * A [subscription](../guides/core-concepts.mdx#subscription) represents the purchase of a plan by a customer.
99
- *
100
- * @remarks
101
- *
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.
104
- *
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).
108
- *
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.
113
- */
114
- var Subscription = /** @class */ (function () {
115
- function Subscription(sdkConfig) {
116
- this.sdkConfiguration = sdkConfig;
117
- }
118
- /**
119
- * Cancel subscription
120
- *
121
- * @remarks
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.
124
- *
125
- * The body parameter `cancel_option` determines the cancellation behavior. Orb supports three cancellation options:
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.
140
- *
141
- * - `immediate`: ends the subscription immediately, setting the `end_date` to the current time:
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.
158
- *
159
- * ## Backdated cancellations
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).
165
- */
166
- Subscription.prototype.cancel = function (subscriptionId, cancelSubscriptionParams, config) {
167
- var _a, _b;
168
- return __awaiter(this, void 0, void 0, function () {
169
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
170
- var _d;
171
- return __generator(this, function (_e) {
172
- switch (_e.label) {
173
- case 0:
174
- req = new operations.CancelSubscriptionRequest({
175
- subscriptionId: subscriptionId,
176
- cancelSubscriptionParams: cancelSubscriptionParams,
177
- });
178
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
179
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/cancel", req);
180
- _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
181
- try {
182
- _d = __read(utils.serializeRequestBody(req, "cancelSubscriptionParams", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
183
- }
184
- catch (e) {
185
- if (e instanceof Error) {
186
- throw new Error("Error serializing request body, cause: ".concat(e.message));
187
- }
188
- }
189
- client = this.sdkConfiguration.defaultClient;
190
- globalSecurity = this.sdkConfiguration.security;
191
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
192
- return [4 /*yield*/, globalSecurity()];
193
- case 1:
194
- globalSecurity = _e.sent();
195
- _e.label = 2;
196
- case 2:
197
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
198
- globalSecurity = new shared.Security(globalSecurity);
199
- }
200
- properties = utils.parseSecurityProperties(globalSecurity);
201
- headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
202
- headers["Accept"] = "application/json";
203
- headers["user-agent"] = this.sdkConfiguration.userAgent;
204
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
205
- case 3:
206
- httpRes = _e.sent();
207
- 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 : "";
208
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
209
- throw new Error("status code not found in response: ".concat(httpRes));
210
- }
211
- res = new operations.CancelSubscriptionResponse({
212
- statusCode: httpRes.status,
213
- contentType: contentType,
214
- rawResponse: httpRes,
215
- });
216
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
217
- switch (true) {
218
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
219
- if (utils.matchContentType(contentType, "application/json")) {
220
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
221
- }
222
- else {
223
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
224
- }
225
- break;
226
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
227
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
228
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
229
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
230
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
231
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
232
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
233
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
234
- if (utils.matchContentType(contentType, "application/json")) {
235
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
236
- err.rawResponse = httpRes;
237
- throw new errors.FourHundredAndOneError(err);
238
- }
239
- else {
240
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
241
- }
242
- break;
243
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
244
- if (utils.matchContentType(contentType, "application/json")) {
245
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
246
- err.rawResponse = httpRes;
247
- throw new errors.FourHundredAndTwentyNineError(err);
248
- }
249
- else {
250
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
251
- }
252
- break;
253
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
254
- if (utils.matchContentType(contentType, "application/json")) {
255
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
256
- err.rawResponse = httpRes;
257
- throw new errors.FiveHundredError(err);
258
- }
259
- else {
260
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
261
- }
262
- break;
263
- }
264
- return [2 /*return*/, res];
265
- }
266
- });
267
- });
268
- };
269
- /**
270
- * Create subscription
271
- *
272
- * @remarks
273
- * A subscription represents the purchase of a plan by a customer. The customer is identified by either the `customer_id`
274
- * or the `external_customer_id`, and exactly one of these fields must be provided.
275
- *
276
- * By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at the
277
- * cadence that's configured in the plan definition.
278
- *
279
- * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning of month alignment** (see
280
- * [Subscription](../guides/concepts#subscription) for more details).
281
- *
282
- * In order to change the alignment behavior, Orb also supports billing subscriptions on the day of the month they are
283
- * created. If `align_billing_with_subscription_start_date = true` is specified, subscriptions have billing cycles that are
284
- * aligned with their `start_date`. For example, a subscription that begins on January 15th will have a billing cycle from
285
- * January 15th to February 15th. Every subsequent billing cycle will continue to start and invoice on the 15th.
286
- *
287
- * 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
288
- * month. For example, if the start_date is January 31st, the next billing cycle will start on February 28th.
289
- *
290
- * If a customer was created with a currency, Orb only allows subscribing the customer to a plan with a matching
291
- * `invoicing_currency`. If the customer does not have a currency set, on subscription creation, we set the customer's
292
- * currency to be the `invoicing_currency` of the plan.
293
- *
294
- * ## Price overrides
295
- *
296
- * Price overrides are used to update some or all prices in a plan for the specific subscription being created. This is
297
- * useful when a new customer has negotiated one or more different prices for a specific plan than the plan's default
298
- * prices. Any type of price can be overridden, if the correct data is provided. The billable metric, cadence, type, and
299
- * name of a price can not be overridden.
300
- *
301
- *
302
- * To override prices, provide a list of objects with the key `price_overrides`. The price object in the list of overrides
303
- * is expected to contain the existing price id, the `model_type` and config value in the format below. The specific
304
- * numerical values can be updated, but the config value and `model_type` must match the existing price that is being
305
- * overridden
306
- *
307
- * ### Request format for price overrides
308
- *
309
- * Orb supports a few different pricing models out of the box. The `model_type` field determines the key for the
310
- * configuration object that is present.
311
- *
312
- * ### Unit pricing
313
- *
314
- * With unit pricing, each unit costs a fixed amount.
315
- *
316
- * ```json
317
- * {
318
- * ...
319
- * "id": "price_id",
320
- * "model_type": "unit",
321
- * "unit_config": {
322
- * "unit_amount": "0.50"
323
- * }
324
- * ...
325
- * }
326
- * ```
327
- *
328
- * ### Tiered pricing
329
- *
330
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into, where each tier range is
331
- * defined by an upper and lower bound. For example, the first ten units may cost $0.50 each and all units thereafter may
332
- * cost $0.10 each. Tiered prices can be overridden with a new number of tiers or new values for `first_unit`, `last_unit`,
333
- * or `unit_amount`.
334
- *
335
- * ```json
336
- * {
337
- * ...
338
- * "id": "price_id",
339
- * "model_type": "tiered",
340
- * "tiered_config": {
341
- * "tiers": [
342
- * {
343
- * "first_unit":"1",
344
- * "last_unit": "10",
345
- * "unit_amount": "0.50"
346
- * },
347
- * {
348
- * "first_unit": "10",
349
- * "last_unit": null,
350
- * "unit_amount": "0.10"
351
- * }
352
- * ]
353
- * }
354
- * ...
355
- * }
356
- * ```
357
- *
358
- * ### Bulk pricing
359
- *
360
- * Bulk pricing applies when the number of units determine the cost of _all_ units. For example, if you've bought less than
361
- * 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
362
- * 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
363
- * values for `maximum_units`, or `unit_amount`.
364
- *
365
- * ```json
366
- * {
367
- * ...
368
- * "id": "price_id",
369
- * "model_type": "bulk",
370
- * "bulk_config": {
371
- * "tiers": [
372
- * {
373
- * "maximum_units": "10",
374
- * "unit_amount": "0.50"
375
- * },
376
- * {
377
- * "maximum_units": "1000",
378
- * "unit_amount": "0.40"
379
- * }
380
- * ]
381
- * }
382
- * ...
383
- * }
384
- * ```
385
- * ### Package pricing
386
- *
387
- * Package pricing defines the size or granularity of a unit for billing purposes. For example, if the package size is set
388
- * to 5, then 4 units will be billed as 5 and 6 units will be billed at 10.
389
- *
390
- * ```json
391
- * {
392
- * ...
393
- * "id": "price_id",
394
- * "model_type": "package",
395
- * "package_config": {
396
- * "package_amount": "0.80",
397
- * "package_size": 10
398
- * }
399
- * ...
400
- * }
401
- * ```
402
- * ### BPS pricing
403
- *
404
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the number of basis points to
405
- * 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
406
- * payment you process, with a maximum charge of $25 per payment.
407
- *
408
- * ```json
409
- * {
410
- * ...
411
- * "id": "price_id"
412
- * "model_type": "bps",
413
- * "bps_config": {
414
- * "bps": 125,
415
- * "per_event_cap": "11.00"
416
- * }
417
- * ...
418
- * }
419
- * ```
420
- * ### Bulk BPS pricing
421
- *
422
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity across all events. Similar
423
- * to bulk pricing, the BPS parameters of a given event depends on the tier range that the billing period falls into. Each
424
- * tier range is defined by an upper and lower bound. For example, after $1.5M of payment volume is reached, each
425
- * individual payment may have a lower cap or a smaller take-rate.
426
- *
427
- * ```json
428
- * {
429
- * ...
430
- * "id": "price_id"
431
- * "model_type": "bulk_bps",
432
- * "bulk_bps_config": {
433
- * "tiers": [
434
- * {
435
- * "minimum_amount": "0.00",
436
- * "maximum_amount": "1000000.00",
437
- * "bps": 125,
438
- * "per_event_cap": "19.00"
439
- * },
440
- * {
441
- * "minimum_amount":"1000000.00",
442
- * "maximum_amount": null,
443
- * "bps": 115,
444
- * "per_event_cap": "4.00"
445
- * }
446
- * ]
447
- * }
448
- * ...
449
- * }
450
- * ```
451
- * ### Tiered BPS pricing
452
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's applicable parameter is a function
453
- * of its marginal addition to the period total. Similar to tiered pricing, the BPS parameters of a given event depends on
454
- * the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first
455
- * 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
456
- * each.
457
- *
458
- * ```json
459
- * {
460
- * ...
461
- * "id": "price_id"
462
- * "model_type": "tiered_bps",
463
- * "tiered_bps_config": {
464
- * "tiers": [
465
- * {
466
- * "minimum_amount": "0.00",
467
- * "maximum_amount": "1000000.00",
468
- * "bps": 125,
469
- * "per_event_cap": "19.00"
470
- * },
471
- * {
472
- * "minimum_amount":"1000000",
473
- * "maximum_amount": null,
474
- * "bps": 115,
475
- * "per_event_cap": "4.00"
476
- * }
477
- * ]
478
- * }
479
- * ...
480
- * }
481
- * ```
482
- * ### Matrix pricing
483
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions` defines the two event
484
- * property values evaluated in this pricing model. In a one-dimensional matrix, the second value is `null`. Every
485
- * configuration has a list of `matrix_values` which give the unit prices for specified property values. In a
486
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second value of the pair is null. If an
487
- * event does not match any of the dimension values in the matrix, it will resort to the `default_unit_amount`.
488
- * ```json
489
- * ...
490
- * "model_type": "matrix"
491
- * "matrix_config": {
492
- * "default_unit_amount": "3.00",
493
- * "dimensions": [
494
- * "cluster_name",
495
- * "region"
496
- * ],
497
- * "matrix_values": [
498
- * {
499
- * "dimension_values": [
500
- * "alpha",
501
- * "west"
502
- * ],
503
- * "unit_amount": "2.00"
504
- * },
505
- * ...
506
- * ]
507
- * }
508
- * ...
509
- * ```
510
- *
511
- * ### Fixed fees
512
- * Fixed fees follow unit pricing, and also have an additional parameter `fixed_price_quantity` that indicates how many of
513
- * a fixed fee that should be applied for a subscription. This parameter defaults to 1.
514
- *
515
- * ```json
516
- * {
517
- * ...
518
- * "id": "price_id",
519
- * "model_type": "unit",
520
- * "unit_config": {
521
- * "unit_amount": "2.00"
522
- * },
523
- * "fixed_price_quantity": 3.0
524
- * ...
525
- * }
526
- * ```
527
- *
528
- * ## Maximums and Minimums
529
- * Minimums and maximums, much like price overrides, can be useful when a new customer has negotiated a new or different
530
- * minimum or maximum spend cap than the default for the plan. Maximums and minimums can be added to either a price or a
531
- * plan. If one exists for a price or plan and null is provided for the minimum/maximum override on creation, then there
532
- * will be no minimum/maximum on the new subscription. If no value is provided, then the default plan maximum or minimum is
533
- * used.
534
- *
535
- * To add a minimum for a specific price, add `minimum_amount` to the specific price in the `price_overrides` object. To
536
- * add a minimum to a plan, add `minimum_amount` to the base object. The value for `minimum_amount` should be a string with
537
- * the minimum dollar amount in decimal format.
538
- *
539
- * To add a maximum for a specific price, add `maximum_amount` to the specific price in the `price_overrides` object. To
540
- * add a maximum to a plan, add `maximum_amount` to the base object. The value for `maximum_amount` should be a string with
541
- * the maximum dollar amount in decimal format.
542
- *
543
- *
544
- * ### Minimum override example
545
- *
546
- * Price minimum override example:
547
- *
548
- * ```json
549
- * {
550
- * ...
551
- * "id": "price_id",
552
- * "model_type": "unit",
553
- * "unit_config": {
554
- * "unit_amount": "0.50"
555
- * },
556
- * "minimum_amount": "100.00"
557
- * ...
558
- * }
559
- * ```
560
- *
561
- *
562
- * Plan minimum override example:
563
- *
564
- * ```json
565
- * {
566
- * "customer_id": "customer_id",
567
- * "plan_id": "plan_id",
568
- * "minimum_amount": "1000.00",
569
- * "price_overrides": [ ... ]
570
- * ...
571
- * }
572
- * ```
573
- *
574
- * Removing an existing minimum example
575
- * ```json
576
- * {
577
- * ...
578
- * "id": "price_id",
579
- * "model_type": "unit",
580
- * "unit_config": {
581
- * "unit_amount": "0.50"
582
- * },
583
- * "minimum_amount": null
584
- * ...
585
- * }
586
- * ```
587
- *
588
- * Using the plan's minimum example
589
- * ```json
590
- * {
591
- * ...
592
- * "id": "price_id",
593
- * "model_type": "unit",
594
- * "unit_config": {
595
- * "unit_amount": "0.50"
596
- * },
597
- * ...
598
- * }
599
- * ```
600
- *
601
- * ## Discounts
602
- * Discounts, like price overrides, can be useful when a new customer has negotiated a new or different discount than the
603
- * 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
604
- * one discount. If a discount exists for a price or a plan and a null discount is provided on creation, then there will be
605
- * no discount on the new subscription.
606
- *
607
- * To add a discount for a specific price, add `discount` to the price in the `price_overrides` object. To add a discount
608
- * to a plan, add `discount` to the base object.
609
- * Discount should be a dictionary of the format:
610
- * ```json
611
- * {
612
- * "discount_type": "amount" | "percentage" | "usage",
613
- * "amount_discount": string,
614
- * "percentage_discount": string,
615
- * "usage_discount": string
616
- * }
617
- * ```
618
- * where either `amount_discount`, `percentage_discount`, or `usage_discount` is provided.
619
- *
620
- * The `usage` type discount can only be created on individual prices and not on the plan.
621
- *
622
- * Price discount example
623
- * ```json
624
- * {
625
- * ...
626
- * "id": "price_id",
627
- * "model_type": "unit",
628
- * "unit_config": {
629
- * "unit_amount": "0.50"
630
- * },
631
- * "discount": {"discount_type": "amount", "amount_discount": "175"},
632
- * }
633
- * ```
634
- *
635
- * Plan discount example
636
- * ```json
637
- * {
638
- * "customer_id": "customer_id",
639
- * "plan_id": "plan_id",
640
- * "discount": {"discount_type": "percentage", "percentage_discount": "12.5"},
641
- * "price_overrides": [ ... ]
642
- * ...
643
- * }
644
- * ```
645
- *
646
- * Removing an existing discount example
647
- * ```json
648
- * {
649
- * "customer_id": "customer_id",
650
- * "plan_id": "plan_id",
651
- * "discount": null,
652
- * "price_overrides": [ ... ]
653
- * ...
654
- * }
655
- * ```
656
- *
657
- * Using the plan's discount example
658
- * ```json
659
- * {
660
- * ...
661
- * "id": "price_id",
662
- * "model_type": "unit",
663
- * "unit_config": {
664
- * "unit_amount": "0.50"
665
- * },
666
- * ...
667
- * }
668
- * ```
669
- *
670
- * ## Threshold Billing
671
- *
672
- * Orb supports invoicing for a subscription when a preconfigured usage threshold is hit. To enable threshold billing, pass
673
- * in an `invoicing_threshold`, which is specified in the subscription's invoicing currency, when creating a subscription.
674
- * Ex. pass in `10.00` to issue an invoice when usage amounts hit $10.00 for a subscription that invoices in USD.
675
- */
676
- Subscription.prototype.create = function (req, config) {
677
- var _a, _b;
678
- return __awaiter(this, void 0, void 0, function () {
679
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
680
- var _d;
681
- return __generator(this, function (_e) {
682
- switch (_e.label) {
683
- case 0:
684
- if (!(req instanceof utils.SpeakeasyBase)) {
685
- req = new shared.NewSubscription(req);
686
- }
687
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
688
- url = baseURL.replace(/\/$/, "") + "/subscriptions";
689
- _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
690
- try {
691
- _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
692
- }
693
- catch (e) {
694
- if (e instanceof Error) {
695
- throw new Error("Error serializing request body, cause: ".concat(e.message));
696
- }
697
- }
698
- client = this.sdkConfiguration.defaultClient;
699
- globalSecurity = this.sdkConfiguration.security;
700
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
701
- return [4 /*yield*/, globalSecurity()];
702
- case 1:
703
- globalSecurity = _e.sent();
704
- _e.label = 2;
705
- case 2:
706
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
707
- globalSecurity = new shared.Security(globalSecurity);
708
- }
709
- properties = utils.parseSecurityProperties(globalSecurity);
710
- headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
711
- headers["Accept"] = "application/json";
712
- headers["user-agent"] = this.sdkConfiguration.userAgent;
713
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
714
- case 3:
715
- httpRes = _e.sent();
716
- 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 : "";
717
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
718
- throw new Error("status code not found in response: ".concat(httpRes));
719
- }
720
- res = new operations.CreateSubscriptionResponse({
721
- statusCode: httpRes.status,
722
- contentType: contentType,
723
- rawResponse: httpRes,
724
- });
725
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
726
- switch (true) {
727
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 201:
728
- if (utils.matchContentType(contentType, "application/json")) {
729
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
730
- }
731
- else {
732
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
733
- }
734
- break;
735
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
736
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
737
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
738
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
739
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
740
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
741
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
742
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
743
- if (utils.matchContentType(contentType, "application/json")) {
744
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
745
- err.rawResponse = httpRes;
746
- throw new errors.FourHundredAndOneError(err);
747
- }
748
- else {
749
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
750
- }
751
- break;
752
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
753
- if (utils.matchContentType(contentType, "application/json")) {
754
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
755
- err.rawResponse = httpRes;
756
- throw new errors.FourHundredAndTwentyNineError(err);
757
- }
758
- else {
759
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
760
- }
761
- break;
762
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
763
- if (utils.matchContentType(contentType, "application/json")) {
764
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
765
- err.rawResponse = httpRes;
766
- throw new errors.FiveHundredError(err);
767
- }
768
- else {
769
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
770
- }
771
- break;
772
- }
773
- return [2 /*return*/, res];
774
- }
775
- });
776
- });
777
- };
778
- /**
779
- * Fetch subscription
780
- *
781
- * @remarks
782
- * This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an identifier.
783
- */
784
- Subscription.prototype.fetch = function (subscriptionId, config) {
785
- var _a, _b;
786
- return __awaiter(this, void 0, void 0, function () {
787
- var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
788
- return __generator(this, function (_c) {
789
- switch (_c.label) {
790
- case 0:
791
- req = new operations.FetchSubscriptionRequest({
792
- subscriptionId: subscriptionId,
793
- });
794
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
795
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}", req);
796
- client = this.sdkConfiguration.defaultClient;
797
- globalSecurity = this.sdkConfiguration.security;
798
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
799
- return [4 /*yield*/, globalSecurity()];
800
- case 1:
801
- globalSecurity = _c.sent();
802
- _c.label = 2;
803
- case 2:
804
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
805
- globalSecurity = new shared.Security(globalSecurity);
806
- }
807
- properties = utils.parseSecurityProperties(globalSecurity);
808
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
809
- headers["Accept"] = "application/json";
810
- headers["user-agent"] = this.sdkConfiguration.userAgent;
811
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
812
- case 3:
813
- httpRes = _c.sent();
814
- 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 : "";
815
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
816
- throw new Error("status code not found in response: ".concat(httpRes));
817
- }
818
- res = new operations.FetchSubscriptionResponse({
819
- statusCode: httpRes.status,
820
- contentType: contentType,
821
- rawResponse: httpRes,
822
- });
823
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
824
- switch (true) {
825
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
826
- if (utils.matchContentType(contentType, "application/json")) {
827
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
828
- }
829
- else {
830
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
831
- }
832
- break;
833
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
834
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
835
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
836
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
837
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
838
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
839
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
840
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
841
- if (utils.matchContentType(contentType, "application/json")) {
842
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
843
- err.rawResponse = httpRes;
844
- throw new errors.FourHundredAndOneError(err);
845
- }
846
- else {
847
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
848
- }
849
- break;
850
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
851
- if (utils.matchContentType(contentType, "application/json")) {
852
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
853
- err.rawResponse = httpRes;
854
- throw new errors.FourHundredAndTwentyNineError(err);
855
- }
856
- else {
857
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
858
- }
859
- break;
860
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
861
- if (utils.matchContentType(contentType, "application/json")) {
862
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
863
- err.rawResponse = httpRes;
864
- throw new errors.FiveHundredError(err);
865
- }
866
- else {
867
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
868
- }
869
- break;
870
- }
871
- return [2 /*return*/, res];
872
- }
873
- });
874
- });
875
- };
876
- /**
877
- * Fetch subscription costs
878
- *
879
- * @remarks
880
- * This endpoint is used to fetch a day-by-day snapshot of a subscription's costs in Orb, calculated by applying
881
- * pricing information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage) to
882
- * fetch usage per metric, in usage units rather than a currency).
883
- *
884
- * The semantics of this endpoint exactly mirror those of [fetching a customer's costs](fetch-customer-costs). Use this
885
- * endpoint to limit your analysis of costs to a specific subscription for the customer (e.g. to de-aggregate costs
886
- * when a customer's subscription has started and stopped on the same day).
887
- */
888
- Subscription.prototype.fetchCosts = function (req, config) {
889
- var _a, _b;
890
- return __awaiter(this, void 0, void 0, function () {
891
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
892
- return __generator(this, function (_c) {
893
- switch (_c.label) {
894
- case 0:
895
- if (!(req instanceof utils.SpeakeasyBase)) {
896
- req = new operations.FetchSubscriptionCostsRequest(req);
897
- }
898
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
899
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/costs", req);
900
- client = this.sdkConfiguration.defaultClient;
901
- globalSecurity = this.sdkConfiguration.security;
902
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
903
- return [4 /*yield*/, globalSecurity()];
904
- case 1:
905
- globalSecurity = _c.sent();
906
- _c.label = 2;
907
- case 2:
908
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
909
- globalSecurity = new shared.Security(globalSecurity);
910
- }
911
- properties = utils.parseSecurityProperties(globalSecurity);
912
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
913
- queryParams = utils.serializeQueryParams(req);
914
- headers["Accept"] = "application/json";
915
- headers["user-agent"] = this.sdkConfiguration.userAgent;
916
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
917
- case 3:
918
- httpRes = _c.sent();
919
- 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 : "";
920
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
921
- throw new Error("status code not found in response: ".concat(httpRes));
922
- }
923
- res = new operations.FetchSubscriptionCostsResponse({
924
- statusCode: httpRes.status,
925
- contentType: contentType,
926
- rawResponse: httpRes,
927
- });
928
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
929
- switch (true) {
930
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
931
- if (utils.matchContentType(contentType, "application/json")) {
932
- res.subscriptionCosts = utils.objectToClass(JSON.parse(decodedRes), shared.SubscriptionCosts);
933
- }
934
- else {
935
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
936
- }
937
- break;
938
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
939
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
940
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
941
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
942
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
943
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
944
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
945
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
946
- if (utils.matchContentType(contentType, "application/json")) {
947
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
948
- err.rawResponse = httpRes;
949
- throw new errors.FourHundredAndOneError(err);
950
- }
951
- else {
952
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
953
- }
954
- break;
955
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
956
- if (utils.matchContentType(contentType, "application/json")) {
957
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
958
- err.rawResponse = httpRes;
959
- throw new errors.FourHundredAndTwentyNineError(err);
960
- }
961
- else {
962
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
963
- }
964
- break;
965
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
966
- if (utils.matchContentType(contentType, "application/json")) {
967
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
968
- err.rawResponse = httpRes;
969
- throw new errors.FiveHundredError(err);
970
- }
971
- else {
972
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
973
- }
974
- break;
975
- }
976
- return [2 /*return*/, res];
977
- }
978
- });
979
- });
980
- };
981
- /**
982
- * Fetch subscription schedule
983
- *
984
- * @remarks
985
- * This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a subscription along
986
- * with their start and end dates. This list contains the subscription's initial plan along with past and future plan
987
- * changes.
988
- */
989
- Subscription.prototype.fetchSchedule = function (req, config) {
990
- var _a, _b;
991
- return __awaiter(this, void 0, void 0, function () {
992
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
993
- return __generator(this, function (_c) {
994
- switch (_c.label) {
995
- case 0:
996
- if (!(req instanceof utils.SpeakeasyBase)) {
997
- req = new operations.FetchSubscriptionScheduleRequest(req);
998
- }
999
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1000
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/schedule", req);
1001
- client = this.sdkConfiguration.defaultClient;
1002
- globalSecurity = this.sdkConfiguration.security;
1003
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1004
- return [4 /*yield*/, globalSecurity()];
1005
- case 1:
1006
- globalSecurity = _c.sent();
1007
- _c.label = 2;
1008
- case 2:
1009
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1010
- globalSecurity = new shared.Security(globalSecurity);
1011
- }
1012
- properties = utils.parseSecurityProperties(globalSecurity);
1013
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1014
- queryParams = utils.serializeQueryParams(req);
1015
- headers["Accept"] = "application/json";
1016
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1017
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1018
- case 3:
1019
- httpRes = _c.sent();
1020
- 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 : "";
1021
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1022
- throw new Error("status code not found in response: ".concat(httpRes));
1023
- }
1024
- res = new operations.FetchSubscriptionScheduleResponse({
1025
- statusCode: httpRes.status,
1026
- contentType: contentType,
1027
- rawResponse: httpRes,
1028
- });
1029
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1030
- switch (true) {
1031
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1032
- if (utils.matchContentType(contentType, "application/json")) {
1033
- res.subscriptionScheduleItems = utils.objectToClass(JSON.parse(decodedRes), shared.SubscriptionScheduleItems);
1034
- }
1035
- else {
1036
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1037
- }
1038
- break;
1039
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1040
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1041
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1042
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1043
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1044
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1045
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1046
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1047
- if (utils.matchContentType(contentType, "application/json")) {
1048
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1049
- err.rawResponse = httpRes;
1050
- throw new errors.FourHundredAndOneError(err);
1051
- }
1052
- else {
1053
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1054
- }
1055
- break;
1056
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1057
- if (utils.matchContentType(contentType, "application/json")) {
1058
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1059
- err.rawResponse = httpRes;
1060
- throw new errors.FourHundredAndTwentyNineError(err);
1061
- }
1062
- else {
1063
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1064
- }
1065
- break;
1066
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1067
- if (utils.matchContentType(contentType, "application/json")) {
1068
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1069
- err.rawResponse = httpRes;
1070
- throw new errors.FiveHundredError(err);
1071
- }
1072
- else {
1073
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1074
- }
1075
- break;
1076
- }
1077
- return [2 /*return*/, res];
1078
- }
1079
- });
1080
- });
1081
- };
1082
- /**
1083
- * Fetch subscription usage
1084
- *
1085
- * @remarks
1086
- * This endpoint is used to fetch a subscription's usage in Orb. Especially when combined with optional query
1087
- * parameters, this endpoint is a powerful way to build visualizations on top of Orb's event data and metrics.
1088
- *
1089
- * With no query parameters specified, this endpoint returns usage for the subscription's _current billing period_
1090
- * across each billable metric that participates in the subscription. Usage quantities returned are the result of
1091
- * evaluating the metric definition for the entirety of the customer's billing period.
1092
- *
1093
- * ### Default response shape
1094
- * Orb returns a `data` array with an object corresponding to each billable metric. Nested within this object is a
1095
- * `usage` array which has a `quantity` value and a corresponding `timeframe_start` and `timeframe_end`. The `quantity`
1096
- * value represents the calculated usage value for the billable metric over the specified timeframe (inclusive of the
1097
- * `timeframe_start` timestamp and exclusive of the `timeframe_end` timestamp).
1098
- *
1099
- * Orb will include _every_ window in the response starting from the beginning of the billing period, even when there
1100
- * were no events (and therefore no usage) in the window. This increases the size of the response but prevents the caller
1101
- * from filling in gaps and handling cumbersome time-based logic.
1102
- *
1103
- * The query parameters in this endpoint serve to override this behavior and provide some key functionality, as listed
1104
- * below. Note that this functionality can also be used _in conjunction_ with each other, e.g. to display grouped usage
1105
- * on a custom timeframe.
1106
- *
1107
- * ## Custom timeframe
1108
- * In order to view usage for a custom timeframe rather than the current billing period, specify a `timeframe_start` and
1109
- * `timeframe_end`. This will calculate quantities for usage incurred between timeframe_start (inclusive) and timeframe_end
1110
- * (exclusive), i.e. `[timeframe_start, timeframe_end)`.
1111
- *
1112
- * Note:
1113
- * - These timestamps must be specified in ISO 8601 format and UTC timezone, e.g. `2022-02-01T05:00:00Z`.
1114
- * - Both parameters must be specified if either is specified.
1115
- *
1116
- * ## Grouping by custom attributes
1117
- * In order to view a single metric grouped by a specific _attribute_ that each event is tagged with (e.g. `cluster`), you
1118
- * must additionally specify a `billable_metric_id` and a `group_by` key. The `group_by` key denotes the event property on
1119
- * which to group.
1120
- *
1121
- * When returning grouped usage, only usage for `billable_metric_id` is returned, and a separate object in the `data` array
1122
- * is returned for each value of the `group_by` key present in your events. The `quantity` value is the result of evaluating
1123
- * the billable metric for events filtered to a single value of the `group_by` key.
1124
- *
1125
- * Orb expects that events that match the billable metric will contain values in the `properties` dictionary that correspond
1126
- * to the `group_by` key specified. By default, Orb will not return a `null` group (i.e. events that match the metric but
1127
- * do not have the key set). Currently, it is only possible to view usage grouped by a single attribute at a time.
1128
- *
1129
- * When viewing grouped usage, Orb uses pagination to limit the response size to 1000 groups by default. If there are more
1130
- * groups for a given subscription, pagination metadata in the response can be used to fetch all of the data.
1131
- *
1132
- * The following example shows usage for an "API Requests" billable metric grouped by `region`. Note the extra `metric_group`
1133
- * dictionary in the response, which provides metadata about the group:
1134
- *
1135
- * ```json
1136
- * {
1137
- * "data": [
1138
- * {
1139
- * "usage": [
1140
- * {
1141
- * "quantity": 0.19291,
1142
- * "timeframe_start": "2021-10-01T07:00:00Z",
1143
- * "timeframe_end": "2021-10-02T07:00:00Z",
1144
- * },
1145
- * ...
1146
- * ],
1147
- * "metric_group": {
1148
- * "property_key": "region",
1149
- * "property_value": "asia/pacific"
1150
- * },
1151
- * "billable_metric": {
1152
- * "id": "Fe9pbpMk86xpwdGB",
1153
- * "name": "API Requests"
1154
- * },
1155
- * "view_mode": "periodic"
1156
- * },
1157
- * ...
1158
- * ]
1159
- * }
1160
- * ```
1161
- *
1162
- *
1163
- * ## Windowed usage
1164
- * The `granularity` parameter can be used to _window_ the usage `quantity` value into periods. When not specified, usage
1165
- * is returned for the entirety of the time range.
1166
- *
1167
- * When `granularity = day` is specified with a timeframe longer than a day, Orb will return a `quantity` value for each
1168
- * full day between `timeframe_start` and `timeframe_end`. Note that the days are demarcated by the _customer's local midnight_.
1169
- *
1170
- * For example, with `timeframe_start = 2022-02-01T05:00:00Z`, `timeframe_end = 2022-02-04T01:00:00Z` and `granularity=day`,
1171
- * the following windows will be returned for a customer in the `America/Los_Angeles` timezone since local midnight is `08:00` UTC:
1172
- * - `[2022-02-01T05:00:00Z, 2022-02-01T08:00:00Z)`
1173
- * - `[2022-02-01T08:00:00, 2022-02-02T08:00:00Z)`
1174
- * - `[2022-02-02T08:00:00, 2022-02-03T08:00:00Z)`
1175
- * - `[2022-02-03T08:00:00, 2022-02-04T01:00:00Z)`
1176
- *
1177
- * ```json
1178
- * {
1179
- * "data": [
1180
- * {
1181
- * "billable_metric": {
1182
- * "id": "Q8w89wjTtBdejXKsm",
1183
- * "name": "API Requests"
1184
- * },
1185
- * "usage": [
1186
- * {
1187
- * "quantity": 0,
1188
- * "timeframe_end": "2022-02-01T08:00:00+00:00",
1189
- * "timeframe_start": "2022-02-01T05:00:00+00:00"
1190
- * },
1191
- * {
1192
- *
1193
- * "quantity": 0,
1194
- * "timeframe_end": "2022-02-02T08:00:00+00:00",
1195
- * "timeframe_start": "2022-02-01T08:00:00+00:00"
1196
- * },
1197
- * {
1198
- * "quantity": 0,
1199
- * "timeframe_end": "2022-02-03T08:00:00+00:00",
1200
- * "timeframe_start": "2022-02-02T08:00:00+00:00"
1201
- * },
1202
- * {
1203
- * "quantity": 0,
1204
- * "timeframe_end": "2022-02-04T01:00:00+00:00",
1205
- * "timeframe_start": "2022-02-03T08:00:00+00:00"
1206
- * }
1207
- * ],
1208
- * "view_mode": "periodic"
1209
- * },
1210
- * ...
1211
- * ]
1212
- * }
1213
- * ```
1214
- *
1215
- * ## Decomposable vs. non-decomposable metrics
1216
- * Billable metrics fall into one of two categories: decomposable and non-decomposable. A decomposable billable metric, such as
1217
- * a sum or a count, can be displayed and aggregated across arbitrary timescales. On the other hand, a non-decomposable metric
1218
- * is not meaningful when only a slice of the billing window is considered.
1219
- *
1220
- * As an example, if we have a billable metric that's defined to count unique users, displaying a graph of unique users for each
1221
- * day is not representative of the billable metric value over the month (days could have an overlapping set of 'unique' users).
1222
- * Instead, what's useful for any given day is the number of unique users in the billing period so far, which are the
1223
- * _cumulative_ unique users.
1224
- *
1225
- * Accordingly, this endpoint returns treats these two types of metrics differently when `group_by` is specified:
1226
- * - Decomposable metrics can be grouped by any event property.
1227
- * - Non-decomposable metrics can only be grouped by the corresponding price's invoice grouping key. If no invoice grouping key
1228
- * is present, the metric does not support `group_by`.
1229
- *
1230
- * ## Matrix prices
1231
- * When a billable metric is attached to a price that uses matrix pricing, it's important to view usage grouped by those matrix
1232
- * dimensions. In this case, use the query parameters `first_dimension_key`, `first_dimension_value` and `second_dimension_key`,
1233
- * `second_dimension_value` while filtering to a specific `billable_metric_id`.
1234
- *
1235
- * For example, if your compute metric has a separate unit price (i.e. a matrix pricing model) per `region` and `provider`,
1236
- * your request might provide the following parameters:
1237
- *
1238
- * - `first_dimension_key`: `region`
1239
- * - `first_dimension_value`: `us-east-1`
1240
- * - `second_dimension_key`: `provider`
1241
- * - `second_dimension_value`: `aws`
1242
- */
1243
- Subscription.prototype.fetchUsage = function (req, config) {
1244
- var _a, _b;
1245
- return __awaiter(this, void 0, void 0, function () {
1246
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
1247
- return __generator(this, function (_c) {
1248
- switch (_c.label) {
1249
- case 0:
1250
- if (!(req instanceof utils.SpeakeasyBase)) {
1251
- req = new operations.FetchSubscriptionUsageRequest(req);
1252
- }
1253
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1254
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/usage", req);
1255
- client = this.sdkConfiguration.defaultClient;
1256
- globalSecurity = this.sdkConfiguration.security;
1257
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1258
- return [4 /*yield*/, globalSecurity()];
1259
- case 1:
1260
- globalSecurity = _c.sent();
1261
- _c.label = 2;
1262
- case 2:
1263
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1264
- globalSecurity = new shared.Security(globalSecurity);
1265
- }
1266
- properties = utils.parseSecurityProperties(globalSecurity);
1267
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1268
- queryParams = utils.serializeQueryParams(req);
1269
- headers["Accept"] = "application/json";
1270
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1271
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1272
- case 3:
1273
- httpRes = _c.sent();
1274
- 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 : "";
1275
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1276
- throw new Error("status code not found in response: ".concat(httpRes));
1277
- }
1278
- res = new operations.FetchSubscriptionUsageResponse({
1279
- statusCode: httpRes.status,
1280
- contentType: contentType,
1281
- rawResponse: httpRes,
1282
- });
1283
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1284
- switch (true) {
1285
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1286
- if (utils.matchContentType(contentType, "application/json")) {
1287
- res.subscriptionUsage = JSON.parse(decodedRes);
1288
- }
1289
- else {
1290
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1291
- }
1292
- break;
1293
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1294
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1295
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1296
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1297
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1298
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1299
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1300
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1301
- if (utils.matchContentType(contentType, "application/json")) {
1302
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1303
- err.rawResponse = httpRes;
1304
- throw new errors.FourHundredAndOneError(err);
1305
- }
1306
- else {
1307
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1308
- }
1309
- break;
1310
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1311
- if (utils.matchContentType(contentType, "application/json")) {
1312
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1313
- err.rawResponse = httpRes;
1314
- throw new errors.FourHundredAndTwentyNineError(err);
1315
- }
1316
- else {
1317
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1318
- }
1319
- break;
1320
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1321
- if (utils.matchContentType(contentType, "application/json")) {
1322
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1323
- err.rawResponse = httpRes;
1324
- throw new errors.FiveHundredError(err);
1325
- }
1326
- else {
1327
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1328
- }
1329
- break;
1330
- }
1331
- return [2 /*return*/, res];
1332
- }
1333
- });
1334
- });
1335
- };
1336
- /**
1337
- * List subscriptions
1338
- *
1339
- * @remarks
1340
- * This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list,
1341
- * ordered starting from the most recently created subscription. For a full discussion of the subscription resource,
1342
- * see [Subscription](../guides/concepts#subscription).
1343
- *
1344
- * Subscriptions can be filtered to a single customer by
1345
- * passing in the `customer_id` query parameter or the `external_customer_id` query parameter.
1346
- */
1347
- Subscription.prototype.list = function (req, config) {
1348
- var _a, _b;
1349
- return __awaiter(this, void 0, void 0, function () {
1350
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
1351
- return __generator(this, function (_c) {
1352
- switch (_c.label) {
1353
- case 0:
1354
- if (!(req instanceof utils.SpeakeasyBase)) {
1355
- req = new operations.ListSubscriptionsRequest(req);
1356
- }
1357
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1358
- url = baseURL.replace(/\/$/, "") + "/subscriptions";
1359
- client = this.sdkConfiguration.defaultClient;
1360
- globalSecurity = this.sdkConfiguration.security;
1361
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1362
- return [4 /*yield*/, globalSecurity()];
1363
- case 1:
1364
- globalSecurity = _c.sent();
1365
- _c.label = 2;
1366
- case 2:
1367
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1368
- globalSecurity = new shared.Security(globalSecurity);
1369
- }
1370
- properties = utils.parseSecurityProperties(globalSecurity);
1371
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1372
- queryParams = utils.serializeQueryParams(req);
1373
- headers["Accept"] = "application/json";
1374
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1375
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
1376
- case 3:
1377
- httpRes = _c.sent();
1378
- 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 : "";
1379
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1380
- throw new Error("status code not found in response: ".concat(httpRes));
1381
- }
1382
- res = new operations.ListSubscriptionsResponse({
1383
- statusCode: httpRes.status,
1384
- contentType: contentType,
1385
- rawResponse: httpRes,
1386
- });
1387
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1388
- switch (true) {
1389
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1390
- if (utils.matchContentType(contentType, "application/json")) {
1391
- res.subscriptions = utils.objectToClass(JSON.parse(decodedRes), shared.Subscriptions);
1392
- }
1393
- else {
1394
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1395
- }
1396
- break;
1397
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1398
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1399
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1400
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1401
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1402
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1403
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1404
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1405
- if (utils.matchContentType(contentType, "application/json")) {
1406
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1407
- err.rawResponse = httpRes;
1408
- throw new errors.FourHundredAndOneError(err);
1409
- }
1410
- else {
1411
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1412
- }
1413
- break;
1414
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1415
- if (utils.matchContentType(contentType, "application/json")) {
1416
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1417
- err.rawResponse = httpRes;
1418
- throw new errors.FourHundredAndTwentyNineError(err);
1419
- }
1420
- else {
1421
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1422
- }
1423
- break;
1424
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1425
- if (utils.matchContentType(contentType, "application/json")) {
1426
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1427
- err.rawResponse = httpRes;
1428
- throw new errors.FiveHundredError(err);
1429
- }
1430
- else {
1431
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1432
- }
1433
- break;
1434
- }
1435
- return [2 /*return*/, res];
1436
- }
1437
- });
1438
- });
1439
- };
1440
- /**
1441
- * Schedule plan change
1442
- *
1443
- * @remarks
1444
- * This endpoint can be used to change the plan on an existing subscription. It returns the serialized updated
1445
- * subscription object.
1446
- *
1447
- * The body parameter `change_option` determines the timing of the plan change. Orb supports three options:
1448
- * - `end_of_subscription_term`: changes the plan at the end of the existing plan's term.
1449
- * - Issuing this plan change request for a monthly subscription will keep the existing plan active until the start
1450
- * of the subsequent month, and potentially issue an invoice for any usage charges incurred in the intervening
1451
- * period.
1452
- * - Issuing this plan change request for a yearly subscription will keep the existing plan active for the full
1453
- * year.
1454
- * - `immediate`: changes the plan immediately. Subscriptions that have their plan changed with this option will be
1455
- * invoiced immediately. This invoice will include any usage fees incurred in the billing period up to the change,
1456
- * along with any prorated recurring fees for the billing period, if applicable.
1457
- * - `requested_date`: changes the plan on the requested date (`change_date`). If no timezone is provided, the
1458
- * customer's timezone is used. The `change_date` body parameter is required if this option is chosen.
1459
- *
1460
- * Note that one of `plan_id` or `external_plan_id` is required in the request body for this operation.
1461
- *
1462
- * ## Price overrides, maximums, and minimums
1463
- * Price overrides are used to update some or all prices in the target plan. Minimums and maximums, much like price
1464
- * overrides, can be useful when a new customer has negotiated a new or different minimum or maximum spend cap than the
1465
- * default for the plan. The request format for price overrides, maximums, and minimums are the same as those in
1466
- * [subscription creation](create-subscription).
1467
- *
1468
- * ## Prorations for in-advance fees
1469
- * By default, Orb calculates the prorated difference in any fixed fees when making a plan change, adjusting the
1470
- * customer balance as needed. For details on this behavior, see
1471
- * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees).
1472
- */
1473
- Subscription.prototype.schedulePlanChange = function (subscriptionId, subscriptionPlanChange, config) {
1474
- var _a, _b;
1475
- return __awaiter(this, void 0, void 0, function () {
1476
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
1477
- var _d;
1478
- return __generator(this, function (_e) {
1479
- switch (_e.label) {
1480
- case 0:
1481
- req = new operations.SchedulePlanChangeRequest({
1482
- subscriptionId: subscriptionId,
1483
- subscriptionPlanChange: subscriptionPlanChange,
1484
- });
1485
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1486
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/schedule_plan_change", req);
1487
- _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1488
- try {
1489
- _d = __read(utils.serializeRequestBody(req, "subscriptionPlanChange", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1490
- }
1491
- catch (e) {
1492
- if (e instanceof Error) {
1493
- throw new Error("Error serializing request body, cause: ".concat(e.message));
1494
- }
1495
- }
1496
- client = this.sdkConfiguration.defaultClient;
1497
- globalSecurity = this.sdkConfiguration.security;
1498
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1499
- return [4 /*yield*/, globalSecurity()];
1500
- case 1:
1501
- globalSecurity = _e.sent();
1502
- _e.label = 2;
1503
- case 2:
1504
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1505
- globalSecurity = new shared.Security(globalSecurity);
1506
- }
1507
- properties = utils.parseSecurityProperties(globalSecurity);
1508
- headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1509
- headers["Accept"] = "application/json";
1510
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1511
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1512
- case 3:
1513
- httpRes = _e.sent();
1514
- 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 : "";
1515
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1516
- throw new Error("status code not found in response: ".concat(httpRes));
1517
- }
1518
- res = new operations.SchedulePlanChangeResponse({
1519
- statusCode: httpRes.status,
1520
- contentType: contentType,
1521
- rawResponse: httpRes,
1522
- });
1523
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1524
- switch (true) {
1525
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1526
- if (utils.matchContentType(contentType, "application/json")) {
1527
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1528
- }
1529
- else {
1530
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1531
- }
1532
- break;
1533
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1534
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1535
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1536
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1537
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1538
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1539
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1540
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1541
- if (utils.matchContentType(contentType, "application/json")) {
1542
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1543
- err.rawResponse = httpRes;
1544
- throw new errors.FourHundredAndOneError(err);
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
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1553
- err.rawResponse = httpRes;
1554
- throw new errors.FourHundredAndTwentyNineError(err);
1555
- }
1556
- else {
1557
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1558
- }
1559
- break;
1560
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1561
- if (utils.matchContentType(contentType, "application/json")) {
1562
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1563
- err.rawResponse = httpRes;
1564
- throw new errors.FiveHundredError(err);
1565
- }
1566
- else {
1567
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1568
- }
1569
- break;
1570
- }
1571
- return [2 /*return*/, res];
1572
- }
1573
- });
1574
- });
1575
- };
1576
- /**
1577
- * Trigger phase
1578
- *
1579
- * @remarks
1580
- * Manually trigger a phase, effective the given date (or the current time, if not specified).
1581
- */
1582
- Subscription.prototype.triggerPhase = function (subscriptionId, triggerSubscriptionPhaseParams, config) {
1583
- var _a, _b;
1584
- return __awaiter(this, void 0, void 0, function () {
1585
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
1586
- var _d;
1587
- return __generator(this, function (_e) {
1588
- switch (_e.label) {
1589
- case 0:
1590
- req = new operations.TriggerPhaseRequest({
1591
- subscriptionId: subscriptionId,
1592
- triggerSubscriptionPhaseParams: triggerSubscriptionPhaseParams,
1593
- });
1594
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1595
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/trigger_phase", req);
1596
- _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1597
- try {
1598
- _d = __read(utils.serializeRequestBody(req, "triggerSubscriptionPhaseParams", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1599
- }
1600
- catch (e) {
1601
- if (e instanceof Error) {
1602
- throw new Error("Error serializing request body, cause: ".concat(e.message));
1603
- }
1604
- }
1605
- client = this.sdkConfiguration.defaultClient;
1606
- globalSecurity = this.sdkConfiguration.security;
1607
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1608
- return [4 /*yield*/, globalSecurity()];
1609
- case 1:
1610
- globalSecurity = _e.sent();
1611
- _e.label = 2;
1612
- case 2:
1613
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1614
- globalSecurity = new shared.Security(globalSecurity);
1615
- }
1616
- properties = utils.parseSecurityProperties(globalSecurity);
1617
- headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1618
- headers["Accept"] = "application/json";
1619
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1620
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1621
- case 3:
1622
- httpRes = _e.sent();
1623
- 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 : "";
1624
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1625
- throw new Error("status code not found in response: ".concat(httpRes));
1626
- }
1627
- res = new operations.TriggerPhaseResponse({
1628
- statusCode: httpRes.status,
1629
- contentType: contentType,
1630
- rawResponse: httpRes,
1631
- });
1632
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1633
- switch (true) {
1634
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1635
- if (utils.matchContentType(contentType, "application/json")) {
1636
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1637
- }
1638
- else {
1639
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1640
- }
1641
- break;
1642
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1643
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1644
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1645
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1646
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1647
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1648
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1649
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1650
- if (utils.matchContentType(contentType, "application/json")) {
1651
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1652
- err.rawResponse = httpRes;
1653
- throw new errors.FourHundredAndOneError(err);
1654
- }
1655
- else {
1656
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1657
- }
1658
- break;
1659
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1660
- if (utils.matchContentType(contentType, "application/json")) {
1661
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1662
- err.rawResponse = httpRes;
1663
- throw new errors.FourHundredAndTwentyNineError(err);
1664
- }
1665
- else {
1666
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1667
- }
1668
- break;
1669
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1670
- if (utils.matchContentType(contentType, "application/json")) {
1671
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1672
- err.rawResponse = httpRes;
1673
- throw new errors.FiveHundredError(err);
1674
- }
1675
- else {
1676
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1677
- }
1678
- break;
1679
- }
1680
- return [2 /*return*/, res];
1681
- }
1682
- });
1683
- });
1684
- };
1685
- /**
1686
- * Unschedule subscription cancellation
1687
- *
1688
- * @remarks
1689
- * This endpoint can be used to unschedule any pending cancellations for a subscription.
1690
- *
1691
- * To be eligible, the subscription must currently be active and have a future cancellation. This operation will turn
1692
- * on auto-renew, ensuring that the subscription does not end at the currently scheduled cancellation time.
1693
- */
1694
- Subscription.prototype.unscheduleCancellation = function (subscriptionId, config) {
1695
- var _a, _b;
1696
- return __awaiter(this, void 0, void 0, function () {
1697
- var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
1698
- return __generator(this, function (_c) {
1699
- switch (_c.label) {
1700
- case 0:
1701
- req = new operations.UnscheduleCancellationRequest({
1702
- subscriptionId: subscriptionId,
1703
- });
1704
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1705
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/unschedule_cancellation", req);
1706
- client = this.sdkConfiguration.defaultClient;
1707
- globalSecurity = this.sdkConfiguration.security;
1708
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1709
- return [4 /*yield*/, globalSecurity()];
1710
- case 1:
1711
- globalSecurity = _c.sent();
1712
- _c.label = 2;
1713
- case 2:
1714
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1715
- globalSecurity = new shared.Security(globalSecurity);
1716
- }
1717
- properties = utils.parseSecurityProperties(globalSecurity);
1718
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1719
- headers["Accept"] = "application/json";
1720
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1721
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer" }, config))];
1722
- case 3:
1723
- httpRes = _c.sent();
1724
- 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 : "";
1725
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1726
- throw new Error("status code not found in response: ".concat(httpRes));
1727
- }
1728
- res = new operations.UnscheduleCancellationResponse({
1729
- statusCode: httpRes.status,
1730
- contentType: contentType,
1731
- rawResponse: httpRes,
1732
- });
1733
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1734
- switch (true) {
1735
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1736
- if (utils.matchContentType(contentType, "application/json")) {
1737
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1738
- }
1739
- else {
1740
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1741
- }
1742
- break;
1743
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1744
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1745
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1746
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1747
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1748
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1749
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1750
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1751
- if (utils.matchContentType(contentType, "application/json")) {
1752
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1753
- err.rawResponse = httpRes;
1754
- throw new errors.FourHundredAndOneError(err);
1755
- }
1756
- else {
1757
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1758
- }
1759
- break;
1760
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1761
- if (utils.matchContentType(contentType, "application/json")) {
1762
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1763
- err.rawResponse = httpRes;
1764
- throw new errors.FourHundredAndTwentyNineError(err);
1765
- }
1766
- else {
1767
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1768
- }
1769
- break;
1770
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1771
- if (utils.matchContentType(contentType, "application/json")) {
1772
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1773
- err.rawResponse = httpRes;
1774
- throw new errors.FiveHundredError(err);
1775
- }
1776
- else {
1777
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1778
- }
1779
- break;
1780
- }
1781
- return [2 /*return*/, res];
1782
- }
1783
- });
1784
- });
1785
- };
1786
- /**
1787
- * Unschedule fixed fee quantity updates
1788
- *
1789
- * @remarks
1790
- * This endpoint can be used to clear scheduled updates to the quantity for a fixed fee.
1791
- *
1792
- * If there are no updates scheduled, this endpoint is a no-op.
1793
- */
1794
- Subscription.prototype.unscheduleFixedFeeQuantity = function (subscriptionId, unscheduleFixedFeeQuantityChangeParams, config) {
1795
- var _a, _b;
1796
- return __awaiter(this, void 0, void 0, function () {
1797
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
1798
- var _d;
1799
- return __generator(this, function (_e) {
1800
- switch (_e.label) {
1801
- case 0:
1802
- req = new operations.UnscheduleFixedFeeQuantityRequest({
1803
- subscriptionId: subscriptionId,
1804
- unscheduleFixedFeeQuantityChangeParams: unscheduleFixedFeeQuantityChangeParams,
1805
- });
1806
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1807
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/unschedule_fixed_fee_quantity_updates", req);
1808
- _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
1809
- try {
1810
- _d = __read(utils.serializeRequestBody(req, "unscheduleFixedFeeQuantityChangeParams", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
1811
- }
1812
- catch (e) {
1813
- if (e instanceof Error) {
1814
- throw new Error("Error serializing request body, cause: ".concat(e.message));
1815
- }
1816
- }
1817
- client = this.sdkConfiguration.defaultClient;
1818
- globalSecurity = this.sdkConfiguration.security;
1819
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1820
- return [4 /*yield*/, globalSecurity()];
1821
- case 1:
1822
- globalSecurity = _e.sent();
1823
- _e.label = 2;
1824
- case 2:
1825
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1826
- globalSecurity = new shared.Security(globalSecurity);
1827
- }
1828
- properties = utils.parseSecurityProperties(globalSecurity);
1829
- headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1830
- headers["Accept"] = "application/json";
1831
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1832
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
1833
- case 3:
1834
- httpRes = _e.sent();
1835
- 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 : "";
1836
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1837
- throw new Error("status code not found in response: ".concat(httpRes));
1838
- }
1839
- res = new operations.UnscheduleFixedFeeQuantityResponse({
1840
- statusCode: httpRes.status,
1841
- contentType: contentType,
1842
- rawResponse: httpRes,
1843
- });
1844
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1845
- switch (true) {
1846
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1847
- if (utils.matchContentType(contentType, "application/json")) {
1848
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1849
- }
1850
- else {
1851
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1852
- }
1853
- break;
1854
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1855
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1856
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1857
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1858
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1859
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1860
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1861
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1862
- if (utils.matchContentType(contentType, "application/json")) {
1863
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1864
- err.rawResponse = httpRes;
1865
- throw new errors.FourHundredAndOneError(err);
1866
- }
1867
- else {
1868
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1869
- }
1870
- break;
1871
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1872
- if (utils.matchContentType(contentType, "application/json")) {
1873
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1874
- err.rawResponse = httpRes;
1875
- throw new errors.FourHundredAndTwentyNineError(err);
1876
- }
1877
- else {
1878
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1879
- }
1880
- break;
1881
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1882
- if (utils.matchContentType(contentType, "application/json")) {
1883
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1884
- err.rawResponse = httpRes;
1885
- throw new errors.FiveHundredError(err);
1886
- }
1887
- else {
1888
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1889
- }
1890
- break;
1891
- }
1892
- return [2 /*return*/, res];
1893
- }
1894
- });
1895
- });
1896
- };
1897
- /**
1898
- * Unschedule plan change
1899
- *
1900
- * @remarks
1901
- * This endpoint can be used to unschedule any pending plan changes on an existing subscription.
1902
- */
1903
- Subscription.prototype.unschedulePlanChange = function (subscriptionId, config) {
1904
- var _a, _b;
1905
- return __awaiter(this, void 0, void 0, function () {
1906
- var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
1907
- return __generator(this, function (_c) {
1908
- switch (_c.label) {
1909
- case 0:
1910
- req = new operations.UnschedulePlanChangeRequest({
1911
- subscriptionId: subscriptionId,
1912
- });
1913
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
1914
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/unschedule_pending_plan_changes", req);
1915
- client = this.sdkConfiguration.defaultClient;
1916
- globalSecurity = this.sdkConfiguration.security;
1917
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
1918
- return [4 /*yield*/, globalSecurity()];
1919
- case 1:
1920
- globalSecurity = _c.sent();
1921
- _c.label = 2;
1922
- case 2:
1923
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
1924
- globalSecurity = new shared.Security(globalSecurity);
1925
- }
1926
- properties = utils.parseSecurityProperties(globalSecurity);
1927
- headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
1928
- headers["Accept"] = "application/json";
1929
- headers["user-agent"] = this.sdkConfiguration.userAgent;
1930
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer" }, config))];
1931
- case 3:
1932
- httpRes = _c.sent();
1933
- 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 : "";
1934
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
1935
- throw new Error("status code not found in response: ".concat(httpRes));
1936
- }
1937
- res = new operations.UnschedulePlanChangeResponse({
1938
- statusCode: httpRes.status,
1939
- contentType: contentType,
1940
- rawResponse: httpRes,
1941
- });
1942
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
1943
- switch (true) {
1944
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
1945
- if (utils.matchContentType(contentType, "application/json")) {
1946
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
1947
- }
1948
- else {
1949
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1950
- }
1951
- break;
1952
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
1953
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
1954
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
1955
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
1956
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
1957
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
1958
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
1959
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
1960
- if (utils.matchContentType(contentType, "application/json")) {
1961
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
1962
- err.rawResponse = httpRes;
1963
- throw new errors.FourHundredAndOneError(err);
1964
- }
1965
- else {
1966
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1967
- }
1968
- break;
1969
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
1970
- if (utils.matchContentType(contentType, "application/json")) {
1971
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
1972
- err.rawResponse = httpRes;
1973
- throw new errors.FourHundredAndTwentyNineError(err);
1974
- }
1975
- else {
1976
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1977
- }
1978
- break;
1979
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
1980
- if (utils.matchContentType(contentType, "application/json")) {
1981
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
1982
- err.rawResponse = httpRes;
1983
- throw new errors.FiveHundredError(err);
1984
- }
1985
- else {
1986
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
1987
- }
1988
- break;
1989
- }
1990
- return [2 /*return*/, res];
1991
- }
1992
- });
1993
- });
1994
- };
1995
- /**
1996
- * Update price quantity
1997
- *
1998
- * @remarks
1999
- * This endpoint can be used to update the quantity for a fixed fee.
2000
- *
2001
- * To be eligible, the subscription must currently be active and the price specified must be a fixed fee (not
2002
- * usage-based). This operation will immediately update the quantity for the fee, or if a `effective_date` is passed
2003
- * in, will update the quantity on the requested date at midnight in the customer's timezone.
2004
- *
2005
- * In order to change the fixed fee quantity as of the next draft invoice for this subscription, pass
2006
- * `change_option=upcoming_invoice` without an `effective_date` specified.
2007
- *
2008
- * If the fee is an in-advance fixed fee, it will also issue an immediate invoice for the difference for the remainder
2009
- * of the billing period.
2010
- */
2011
- Subscription.prototype.updateFixedFeeQuantity = function (subscriptionId, fixedFeeQuantityChange, config) {
2012
- var _a, _b;
2013
- return __awaiter(this, void 0, void 0, function () {
2014
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
2015
- var _d;
2016
- return __generator(this, function (_e) {
2017
- switch (_e.label) {
2018
- case 0:
2019
- req = new operations.UpdateFixedFeeQuantityRequest({
2020
- subscriptionId: subscriptionId,
2021
- fixedFeeQuantityChange: fixedFeeQuantityChange,
2022
- });
2023
- baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
2024
- url = utils.generateURL(baseURL, "/subscriptions/{subscription_id}/update_fixed_fee_quantity", req);
2025
- _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
2026
- try {
2027
- _d = __read(utils.serializeRequestBody(req, "fixedFeeQuantityChange", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
2028
- }
2029
- catch (e) {
2030
- if (e instanceof Error) {
2031
- throw new Error("Error serializing request body, cause: ".concat(e.message));
2032
- }
2033
- }
2034
- client = this.sdkConfiguration.defaultClient;
2035
- globalSecurity = this.sdkConfiguration.security;
2036
- if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
2037
- return [4 /*yield*/, globalSecurity()];
2038
- case 1:
2039
- globalSecurity = _e.sent();
2040
- _e.label = 2;
2041
- case 2:
2042
- if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
2043
- globalSecurity = new shared.Security(globalSecurity);
2044
- }
2045
- properties = utils.parseSecurityProperties(globalSecurity);
2046
- headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
2047
- headers["Accept"] = "application/json";
2048
- headers["user-agent"] = this.sdkConfiguration.userAgent;
2049
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
2050
- case 3:
2051
- httpRes = _e.sent();
2052
- 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 : "";
2053
- if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
2054
- throw new Error("status code not found in response: ".concat(httpRes));
2055
- }
2056
- res = new operations.UpdateFixedFeeQuantityResponse({
2057
- statusCode: httpRes.status,
2058
- contentType: contentType,
2059
- rawResponse: httpRes,
2060
- });
2061
- decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
2062
- switch (true) {
2063
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
2064
- if (utils.matchContentType(contentType, "application/json")) {
2065
- res.subscription = utils.objectToClass(JSON.parse(decodedRes), shared.Subscription);
2066
- }
2067
- else {
2068
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2069
- }
2070
- break;
2071
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
2072
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
2073
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
2074
- (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
2075
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
2076
- ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
2077
- throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
2078
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
2079
- if (utils.matchContentType(contentType, "application/json")) {
2080
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
2081
- err.rawResponse = httpRes;
2082
- throw new errors.FourHundredAndOneError(err);
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) == 429:
2089
- if (utils.matchContentType(contentType, "application/json")) {
2090
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
2091
- err.rawResponse = httpRes;
2092
- throw new errors.FourHundredAndTwentyNineError(err);
2093
- }
2094
- else {
2095
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2096
- }
2097
- break;
2098
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
2099
- if (utils.matchContentType(contentType, "application/json")) {
2100
- err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
2101
- err.rawResponse = httpRes;
2102
- throw new errors.FiveHundredError(err);
2103
- }
2104
- else {
2105
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
2106
- }
2107
- break;
2108
- }
2109
- return [2 /*return*/, res];
2110
- }
2111
- });
2112
- });
2113
- };
2114
- return Subscription;
2115
- }());
2116
- exports.Subscription = Subscription;