orb-billing 1.20.0 → 1.20.1

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 (257) hide show
  1. package/dist/sdk/availability.js +17 -36
  2. package/dist/sdk/coupon.js +85 -180
  3. package/dist/sdk/credit.js +102 -216
  4. package/dist/sdk/creditnote.js +34 -72
  5. package/dist/sdk/customer.js +221 -468
  6. package/dist/sdk/event.js +153 -324
  7. package/dist/sdk/invoice.js +136 -288
  8. package/dist/sdk/item.js +34 -72
  9. package/dist/sdk/metric.js +51 -108
  10. package/dist/sdk/models/errors/fivehundrederror.d.ts +12 -0
  11. package/dist/sdk/models/errors/fivehundrederror.js +112 -0
  12. package/dist/sdk/models/errors/fourhundredandoneerror.d.ts +12 -0
  13. package/dist/sdk/models/errors/fourhundredandoneerror.js +112 -0
  14. package/dist/sdk/models/errors/fourhundredandtwentynineerror.d.ts +12 -0
  15. package/dist/sdk/models/errors/fourhundredandtwentynineerror.js +112 -0
  16. package/dist/sdk/models/errors/index.d.ts +3 -0
  17. package/dist/sdk/models/errors/index.js +3 -0
  18. package/dist/sdk/models/operations/addeditpriceintervals.d.ts +0 -28
  19. package/dist/sdk/models/operations/addeditpriceintervals.js +0 -28
  20. package/dist/sdk/models/operations/amendevent.d.ts +0 -28
  21. package/dist/sdk/models/operations/amendevent.js +0 -28
  22. package/dist/sdk/models/operations/amendusage.d.ts +0 -28
  23. package/dist/sdk/models/operations/amendusage.js +0 -28
  24. package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +0 -28
  25. package/dist/sdk/models/operations/amendusageexternalcustomerid.js +0 -28
  26. package/dist/sdk/models/operations/archivecoupon.d.ts +0 -28
  27. package/dist/sdk/models/operations/archivecoupon.js +0 -28
  28. package/dist/sdk/models/operations/cancelsubscription.d.ts +0 -28
  29. package/dist/sdk/models/operations/cancelsubscription.js +0 -28
  30. package/dist/sdk/models/operations/closebackfill.d.ts +0 -28
  31. package/dist/sdk/models/operations/closebackfill.js +0 -28
  32. package/dist/sdk/models/operations/createbackfill.d.ts +0 -28
  33. package/dist/sdk/models/operations/createbackfill.js +0 -28
  34. package/dist/sdk/models/operations/createcoupon.d.ts +0 -28
  35. package/dist/sdk/models/operations/createcoupon.js +0 -28
  36. package/dist/sdk/models/operations/createcustomer.d.ts +0 -28
  37. package/dist/sdk/models/operations/createcustomer.js +0 -28
  38. package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +0 -28
  39. package/dist/sdk/models/operations/createcustomerbalancetransaction.js +0 -28
  40. package/dist/sdk/models/operations/createinvoice.d.ts +0 -28
  41. package/dist/sdk/models/operations/createinvoice.js +0 -28
  42. package/dist/sdk/models/operations/createinvoicelineitem.d.ts +0 -28
  43. package/dist/sdk/models/operations/createinvoicelineitem.js +0 -28
  44. package/dist/sdk/models/operations/createledgerentry.d.ts +0 -29
  45. package/dist/sdk/models/operations/createledgerentry.js +0 -52
  46. package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +0 -29
  47. package/dist/sdk/models/operations/createledgerentryexternalid.js +0 -52
  48. package/dist/sdk/models/operations/createmetric.d.ts +0 -28
  49. package/dist/sdk/models/operations/createmetric.js +0 -28
  50. package/dist/sdk/models/operations/createplan.d.ts +0 -28
  51. package/dist/sdk/models/operations/createplan.js +0 -28
  52. package/dist/sdk/models/operations/createprice.d.ts +0 -29
  53. package/dist/sdk/models/operations/createprice.js +0 -52
  54. package/dist/sdk/models/operations/createsubscription.d.ts +0 -28
  55. package/dist/sdk/models/operations/createsubscription.js +0 -28
  56. package/dist/sdk/models/operations/deletecustomer.d.ts +0 -28
  57. package/dist/sdk/models/operations/deletecustomer.js +0 -28
  58. package/dist/sdk/models/operations/deprecateevent.d.ts +0 -28
  59. package/dist/sdk/models/operations/deprecateevent.js +0 -28
  60. package/dist/sdk/models/operations/fetchbackfill.d.ts +0 -28
  61. package/dist/sdk/models/operations/fetchbackfill.js +0 -28
  62. package/dist/sdk/models/operations/fetchcoupon.d.ts +0 -28
  63. package/dist/sdk/models/operations/fetchcoupon.js +0 -28
  64. package/dist/sdk/models/operations/fetchcreditnote.d.ts +0 -28
  65. package/dist/sdk/models/operations/fetchcreditnote.js +0 -28
  66. package/dist/sdk/models/operations/fetchcustomer.d.ts +0 -28
  67. package/dist/sdk/models/operations/fetchcustomer.js +0 -28
  68. package/dist/sdk/models/operations/fetchcustomercosts.d.ts +0 -28
  69. package/dist/sdk/models/operations/fetchcustomercosts.js +0 -28
  70. package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +0 -28
  71. package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +0 -28
  72. package/dist/sdk/models/operations/fetchcustomercredits.d.ts +0 -28
  73. package/dist/sdk/models/operations/fetchcustomercredits.js +0 -28
  74. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +0 -28
  75. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +0 -28
  76. package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +0 -28
  77. package/dist/sdk/models/operations/fetchcustomercreditsledger.js +0 -28
  78. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +0 -28
  79. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +0 -28
  80. package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +0 -28
  81. package/dist/sdk/models/operations/fetchcustomerexternalid.js +0 -28
  82. package/dist/sdk/models/operations/fetchinvoice.d.ts +0 -28
  83. package/dist/sdk/models/operations/fetchinvoice.js +0 -28
  84. package/dist/sdk/models/operations/fetchitem.d.ts +0 -28
  85. package/dist/sdk/models/operations/fetchitem.js +0 -28
  86. package/dist/sdk/models/operations/fetchmetric.d.ts +0 -28
  87. package/dist/sdk/models/operations/fetchmetric.js +0 -28
  88. package/dist/sdk/models/operations/fetchplan.d.ts +0 -28
  89. package/dist/sdk/models/operations/fetchplan.js +0 -28
  90. package/dist/sdk/models/operations/fetchplanexternalid.d.ts +0 -28
  91. package/dist/sdk/models/operations/fetchplanexternalid.js +0 -28
  92. package/dist/sdk/models/operations/fetchprice.d.ts +0 -29
  93. package/dist/sdk/models/operations/fetchprice.js +0 -52
  94. package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +0 -29
  95. package/dist/sdk/models/operations/fetchpriceexternalid.js +0 -52
  96. package/dist/sdk/models/operations/fetchsubscription.d.ts +0 -28
  97. package/dist/sdk/models/operations/fetchsubscription.js +0 -28
  98. package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +0 -28
  99. package/dist/sdk/models/operations/fetchsubscriptioncosts.js +0 -28
  100. package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +0 -28
  101. package/dist/sdk/models/operations/fetchsubscriptionschedule.js +0 -28
  102. package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +0 -29
  103. package/dist/sdk/models/operations/fetchsubscriptionusage.js +0 -52
  104. package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +0 -28
  105. package/dist/sdk/models/operations/fetchupcominginvoice.js +0 -28
  106. package/dist/sdk/models/operations/ingest.d.ts +0 -28
  107. package/dist/sdk/models/operations/ingest.js +0 -28
  108. package/dist/sdk/models/operations/issueinvoice.d.ts +0 -28
  109. package/dist/sdk/models/operations/issueinvoice.js +0 -28
  110. package/dist/sdk/models/operations/listbackfills.d.ts +0 -28
  111. package/dist/sdk/models/operations/listbackfills.js +0 -28
  112. package/dist/sdk/models/operations/listbalancetransactions.d.ts +0 -28
  113. package/dist/sdk/models/operations/listbalancetransactions.js +0 -28
  114. package/dist/sdk/models/operations/listcoupons.d.ts +0 -28
  115. package/dist/sdk/models/operations/listcoupons.js +0 -28
  116. package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +0 -28
  117. package/dist/sdk/models/operations/listcouponsubscriptions.js +0 -28
  118. package/dist/sdk/models/operations/listcreditnotes.d.ts +0 -28
  119. package/dist/sdk/models/operations/listcreditnotes.js +0 -28
  120. package/dist/sdk/models/operations/listcustomers.d.ts +0 -28
  121. package/dist/sdk/models/operations/listcustomers.js +0 -28
  122. package/dist/sdk/models/operations/listinvoices.d.ts +0 -28
  123. package/dist/sdk/models/operations/listinvoices.js +0 -28
  124. package/dist/sdk/models/operations/listitems.d.ts +0 -28
  125. package/dist/sdk/models/operations/listitems.js +0 -28
  126. package/dist/sdk/models/operations/listmetrics.d.ts +0 -28
  127. package/dist/sdk/models/operations/listmetrics.js +0 -28
  128. package/dist/sdk/models/operations/listplans.d.ts +0 -28
  129. package/dist/sdk/models/operations/listplans.js +0 -28
  130. package/dist/sdk/models/operations/listprices.d.ts +0 -28
  131. package/dist/sdk/models/operations/listprices.js +0 -28
  132. package/dist/sdk/models/operations/listsubscriptions.d.ts +0 -28
  133. package/dist/sdk/models/operations/listsubscriptions.js +0 -28
  134. package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +0 -28
  135. package/dist/sdk/models/operations/markinvoiceaspaid.js +0 -28
  136. package/dist/sdk/models/operations/ping.d.ts +0 -28
  137. package/dist/sdk/models/operations/ping.js +0 -28
  138. package/dist/sdk/models/operations/revertbackfill.d.ts +0 -28
  139. package/dist/sdk/models/operations/revertbackfill.js +0 -28
  140. package/dist/sdk/models/operations/scheduleplanchange.d.ts +0 -28
  141. package/dist/sdk/models/operations/scheduleplanchange.js +0 -28
  142. package/dist/sdk/models/operations/searchevents.d.ts +0 -28
  143. package/dist/sdk/models/operations/searchevents.js +0 -28
  144. package/dist/sdk/models/operations/triggerphase.d.ts +0 -28
  145. package/dist/sdk/models/operations/triggerphase.js +0 -28
  146. package/dist/sdk/models/operations/unschedulecancellation.d.ts +0 -28
  147. package/dist/sdk/models/operations/unschedulecancellation.js +0 -28
  148. package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +0 -28
  149. package/dist/sdk/models/operations/unschedulefixedfeequantity.js +0 -28
  150. package/dist/sdk/models/operations/unscheduleplanchange.d.ts +0 -28
  151. package/dist/sdk/models/operations/unscheduleplanchange.js +0 -28
  152. package/dist/sdk/models/operations/updatecustomer.d.ts +0 -28
  153. package/dist/sdk/models/operations/updatecustomer.js +0 -28
  154. package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +0 -28
  155. package/dist/sdk/models/operations/updatecustomerexternalid.js +0 -28
  156. package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +0 -28
  157. package/dist/sdk/models/operations/updatefixedfeequantity.js +0 -28
  158. package/dist/sdk/models/operations/updateplan.d.ts +0 -28
  159. package/dist/sdk/models/operations/updateplan.js +0 -28
  160. package/dist/sdk/models/operations/updateplanexternal.d.ts +0 -28
  161. package/dist/sdk/models/operations/updateplanexternal.js +0 -28
  162. package/dist/sdk/models/operations/voidinvoice.d.ts +0 -28
  163. package/dist/sdk/models/operations/voidinvoice.js +0 -28
  164. package/dist/sdk/models/shared/fivehundrederror.d.ts +0 -10
  165. package/dist/sdk/models/shared/fivehundrederror.js +1 -69
  166. package/dist/sdk/models/shared/fourhundredandoneerror.d.ts +0 -10
  167. package/dist/sdk/models/shared/fourhundredandoneerror.js +1 -69
  168. package/dist/sdk/models/shared/fourhundredandtwentynineerror.d.ts +0 -10
  169. package/dist/sdk/models/shared/fourhundredandtwentynineerror.js +1 -69
  170. package/dist/sdk/plan.js +102 -216
  171. package/dist/sdk/price.js +68 -144
  172. package/dist/sdk/priceinterval.js +17 -36
  173. package/dist/sdk/sdk.js +2 -2
  174. package/dist/sdk/subscription.js +221 -468
  175. package/docs/models/errors/fivehundrederror.md +12 -0
  176. package/docs/models/errors/fourhundredandoneerror.md +12 -0
  177. package/docs/models/errors/fourhundredandtwentynineerror.md +12 -0
  178. package/docs/models/operations/addeditpriceintervalsresponse.md +6 -13
  179. package/docs/models/operations/amendeventresponse.md +6 -13
  180. package/docs/models/operations/amendusageexternalcustomeridresponse.md +6 -13
  181. package/docs/models/operations/amendusageresponse.md +6 -13
  182. package/docs/models/operations/archivecouponresponse.md +6 -13
  183. package/docs/models/operations/cancelsubscriptionresponse.md +6 -13
  184. package/docs/models/operations/closebackfillresponse.md +6 -13
  185. package/docs/models/operations/createbackfillresponse.md +6 -13
  186. package/docs/models/operations/createcouponresponse.md +6 -13
  187. package/docs/models/operations/createcustomerbalancetransactionresponse.md +6 -13
  188. package/docs/models/operations/createcustomerresponse.md +6 -13
  189. package/docs/models/operations/createinvoicelineitemresponse.md +6 -13
  190. package/docs/models/operations/createinvoiceresponse.md +6 -13
  191. package/docs/models/operations/createledgerentryexternalidresponse.md +6 -13
  192. package/docs/models/operations/createledgerentryresponse.md +6 -13
  193. package/docs/models/operations/createmetricresponse.md +6 -13
  194. package/docs/models/operations/createplanresponse.md +6 -13
  195. package/docs/models/operations/createpriceresponse.md +6 -13
  196. package/docs/models/operations/createsubscriptionresponse.md +6 -13
  197. package/docs/models/operations/deletecustomerresponse.md +6 -13
  198. package/docs/models/operations/deprecateeventresponse.md +6 -13
  199. package/docs/models/operations/fetchbackfillresponse.md +6 -13
  200. package/docs/models/operations/fetchcouponresponse.md +6 -13
  201. package/docs/models/operations/fetchcreditnoteresponse.md +6 -13
  202. package/docs/models/operations/fetchcustomercostsexternalidresponse.md +6 -13
  203. package/docs/models/operations/fetchcustomercostsresponse.md +6 -13
  204. package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +6 -13
  205. package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +6 -13
  206. package/docs/models/operations/fetchcustomercreditsledgerresponse.md +6 -13
  207. package/docs/models/operations/fetchcustomercreditsresponse.md +6 -13
  208. package/docs/models/operations/fetchcustomerexternalidresponse.md +6 -13
  209. package/docs/models/operations/fetchcustomerresponse.md +6 -13
  210. package/docs/models/operations/fetchinvoiceresponse.md +6 -13
  211. package/docs/models/operations/fetchitemresponse.md +6 -13
  212. package/docs/models/operations/fetchmetricresponse.md +6 -13
  213. package/docs/models/operations/fetchplanexternalidresponse.md +6 -13
  214. package/docs/models/operations/fetchplanresponse.md +6 -13
  215. package/docs/models/operations/fetchpriceexternalidresponse.md +6 -13
  216. package/docs/models/operations/fetchpriceresponse.md +6 -13
  217. package/docs/models/operations/fetchsubscriptioncostsresponse.md +6 -13
  218. package/docs/models/operations/fetchsubscriptionresponse.md +6 -13
  219. package/docs/models/operations/fetchsubscriptionscheduleresponse.md +6 -13
  220. package/docs/models/operations/fetchsubscriptionusageresponse.md +6 -13
  221. package/docs/models/operations/fetchupcominginvoiceresponse.md +6 -13
  222. package/docs/models/operations/ingestresponse.md +6 -13
  223. package/docs/models/operations/issueinvoiceresponse.md +6 -13
  224. package/docs/models/operations/listbackfillsresponse.md +6 -13
  225. package/docs/models/operations/listbalancetransactionsresponse.md +6 -13
  226. package/docs/models/operations/listcouponsresponse.md +6 -13
  227. package/docs/models/operations/listcouponsubscriptionsresponse.md +6 -13
  228. package/docs/models/operations/listcreditnotesresponse.md +6 -13
  229. package/docs/models/operations/listcustomersresponse.md +6 -13
  230. package/docs/models/operations/listinvoicesresponse.md +6 -13
  231. package/docs/models/operations/listitemsresponse.md +6 -13
  232. package/docs/models/operations/listmetricsresponse.md +6 -13
  233. package/docs/models/operations/listplansresponse.md +6 -13
  234. package/docs/models/operations/listpricesresponse.md +6 -13
  235. package/docs/models/operations/listsubscriptionsresponse.md +6 -13
  236. package/docs/models/operations/markinvoiceaspaidresponse.md +6 -13
  237. package/docs/models/operations/pingresponse.md +6 -13
  238. package/docs/models/operations/revertbackfillresponse.md +6 -13
  239. package/docs/models/operations/scheduleplanchangeresponse.md +6 -13
  240. package/docs/models/operations/searcheventsresponse.md +6 -13
  241. package/docs/models/operations/triggerphaseresponse.md +6 -13
  242. package/docs/models/operations/unschedulecancellationresponse.md +6 -13
  243. package/docs/models/operations/unschedulefixedfeequantityresponse.md +6 -13
  244. package/docs/models/operations/unscheduleplanchangeresponse.md +6 -13
  245. package/docs/models/operations/updatecustomerexternalidresponse.md +6 -13
  246. package/docs/models/operations/updatecustomerresponse.md +6 -13
  247. package/docs/models/operations/updatefixedfeequantityresponse.md +6 -13
  248. package/docs/models/operations/updateplanexternalresponse.md +6 -13
  249. package/docs/models/operations/updateplanresponse.md +6 -13
  250. package/docs/models/operations/voidinvoiceresponse.md +6 -13
  251. package/package.json +1 -1
  252. package/docs/models/shared/fivehundrederror.md +0 -12
  253. package/docs/models/shared/fourhundredandoneerror.md +0 -12
  254. package/docs/models/shared/fourhundredandtwentynineerror.md +0 -12
  255. /package/docs/models/{shared → errors}/fivehundrederrorheaders.md +0 -0
  256. /package/docs/models/{shared → errors}/fourhundredandoneerrorheaders.md +0 -0
  257. /package/docs/models/{shared → errors}/fourhundredandtwentynineerrorheaders.md +0 -0
@@ -2,42 +2,8 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
- var __extends = (this && this.__extends) || (function () {
6
- var extendStatics = function (d, b) {
7
- extendStatics = Object.setPrototypeOf ||
8
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
9
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10
- return extendStatics(d, b);
11
- };
12
- return function (d, b) {
13
- if (typeof b !== "function" && b !== null)
14
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
15
- extendStatics(d, b);
16
- function __() { this.constructor = d; }
17
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18
- };
19
- })();
20
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
21
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24
- return c > 3 && r && Object.defineProperty(target, key, r), r;
25
- };
26
- var __metadata = (this && this.__metadata) || function (k, v) {
27
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
28
- };
29
5
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.FourHundredAndTwentyNineError = exports.FourHundredAndTwentyNineErrorType = exports.FourHundredAndTwentyNineErrorStatus = exports.FourHundredAndTwentyNineErrorHeaders = void 0;
31
- var utils_1 = require("../../../internal/utils");
32
- var class_transformer_1 = require("class-transformer");
33
- var FourHundredAndTwentyNineErrorHeaders = /** @class */ (function (_super) {
34
- __extends(FourHundredAndTwentyNineErrorHeaders, _super);
35
- function FourHundredAndTwentyNineErrorHeaders() {
36
- return _super !== null && _super.apply(this, arguments) || this;
37
- }
38
- return FourHundredAndTwentyNineErrorHeaders;
39
- }(utils_1.SpeakeasyBase));
40
- exports.FourHundredAndTwentyNineErrorHeaders = FourHundredAndTwentyNineErrorHeaders;
6
+ exports.FourHundredAndTwentyNineErrorType = exports.FourHundredAndTwentyNineErrorStatus = void 0;
41
7
  var FourHundredAndTwentyNineErrorStatus;
42
8
  (function (FourHundredAndTwentyNineErrorStatus) {
43
9
  FourHundredAndTwentyNineErrorStatus[FourHundredAndTwentyNineErrorStatus["FourHundredAndTwentyNine"] = 429] = "FourHundredAndTwentyNine";
@@ -46,37 +12,3 @@ var FourHundredAndTwentyNineErrorType;
46
12
  (function (FourHundredAndTwentyNineErrorType) {
47
13
  FourHundredAndTwentyNineErrorType["HttpsDocsWithorbComReferenceErrorResponsesNumber429TooManyRequests"] = "https://docs.withorb.com/reference/error-responses#429-too-many-requests";
48
14
  })(FourHundredAndTwentyNineErrorType = exports.FourHundredAndTwentyNineErrorType || (exports.FourHundredAndTwentyNineErrorType = {}));
49
- var FourHundredAndTwentyNineError = /** @class */ (function (_super) {
50
- __extends(FourHundredAndTwentyNineError, _super);
51
- function FourHundredAndTwentyNineError() {
52
- return _super !== null && _super.apply(this, arguments) || this;
53
- }
54
- __decorate([
55
- (0, utils_1.SpeakeasyMetadata)(),
56
- (0, class_transformer_1.Expose)({ name: "detail" }),
57
- __metadata("design:type", String)
58
- ], FourHundredAndTwentyNineError.prototype, "detail", void 0);
59
- __decorate([
60
- (0, utils_1.SpeakeasyMetadata)(),
61
- (0, class_transformer_1.Expose)({ name: "headers" }),
62
- (0, class_transformer_1.Type)(function () { return FourHundredAndTwentyNineErrorHeaders; }),
63
- __metadata("design:type", FourHundredAndTwentyNineErrorHeaders)
64
- ], FourHundredAndTwentyNineError.prototype, "headers", void 0);
65
- __decorate([
66
- (0, utils_1.SpeakeasyMetadata)(),
67
- (0, class_transformer_1.Expose)({ name: "status" }),
68
- __metadata("design:type", Number)
69
- ], FourHundredAndTwentyNineError.prototype, "status", void 0);
70
- __decorate([
71
- (0, utils_1.SpeakeasyMetadata)(),
72
- (0, class_transformer_1.Expose)({ name: "title" }),
73
- __metadata("design:type", String)
74
- ], FourHundredAndTwentyNineError.prototype, "title", void 0);
75
- __decorate([
76
- (0, utils_1.SpeakeasyMetadata)(),
77
- (0, class_transformer_1.Expose)({ name: "type" }),
78
- __metadata("design:type", String)
79
- ], FourHundredAndTwentyNineError.prototype, "type", void 0);
80
- return FourHundredAndTwentyNineError;
81
- }(utils_1.SpeakeasyBase));
82
- exports.FourHundredAndTwentyNineError = FourHundredAndTwentyNineError;
package/dist/sdk/plan.js CHANGED
@@ -114,7 +114,7 @@ var Plan = /** @class */ (function () {
114
114
  Plan.prototype.create = function (req, config) {
115
115
  var _a, _b;
116
116
  return __awaiter(this, void 0, void 0, function () {
117
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
117
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
118
118
  var _d;
119
119
  return __generator(this, function (_e) {
120
120
  switch (_e.label) {
@@ -170,41 +170,18 @@ var Plan = /** @class */ (function () {
170
170
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
171
171
  }
172
172
  break;
173
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
174
- if (utils.matchContentType(contentType, "application/json")) {
175
- res.fourHundredError = JSON.parse(decodedRes);
176
- }
177
- else {
178
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
179
- }
180
- break;
173
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
174
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
175
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
176
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
177
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
178
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
179
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
181
180
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
182
181
  if (utils.matchContentType(contentType, "application/json")) {
183
- res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
184
- }
185
- else {
186
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
187
- }
188
- break;
189
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
190
- if (utils.matchContentType(contentType, "application/json")) {
191
- res.fourHundredAndFourError = JSON.parse(decodedRes);
192
- }
193
- else {
194
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
195
- }
196
- break;
197
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
198
- if (utils.matchContentType(contentType, "application/json")) {
199
- res.fourHundredAndNineError = JSON.parse(decodedRes);
200
- }
201
- else {
202
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
203
- }
204
- break;
205
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
206
- if (utils.matchContentType(contentType, "application/json")) {
207
- res.fourHundredAndThirteenError = JSON.parse(decodedRes);
182
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
183
+ err.rawResponse = httpRes;
184
+ throw new errors.FourHundredAndOneError(err);
208
185
  }
209
186
  else {
210
187
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -212,7 +189,9 @@ var Plan = /** @class */ (function () {
212
189
  break;
213
190
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
214
191
  if (utils.matchContentType(contentType, "application/json")) {
215
- res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
192
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
193
+ err.rawResponse = httpRes;
194
+ throw new errors.FourHundredAndTwentyNineError(err);
216
195
  }
217
196
  else {
218
197
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -220,7 +199,9 @@ var Plan = /** @class */ (function () {
220
199
  break;
221
200
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
222
201
  if (utils.matchContentType(contentType, "application/json")) {
223
- res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
202
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
203
+ err.rawResponse = httpRes;
204
+ throw new errors.FiveHundredError(err);
224
205
  }
225
206
  else {
226
207
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -253,7 +234,7 @@ var Plan = /** @class */ (function () {
253
234
  Plan.prototype.fetch = function (planId, config) {
254
235
  var _a, _b;
255
236
  return __awaiter(this, void 0, void 0, function () {
256
- var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
237
+ var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
257
238
  return __generator(this, function (_c) {
258
239
  switch (_c.label) {
259
240
  case 0:
@@ -299,41 +280,18 @@ var Plan = /** @class */ (function () {
299
280
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
300
281
  }
301
282
  break;
302
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
303
- if (utils.matchContentType(contentType, "application/json")) {
304
- res.fourHundredError = JSON.parse(decodedRes);
305
- }
306
- else {
307
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
308
- }
309
- break;
283
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
284
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
285
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
286
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
287
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
288
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
289
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
310
290
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
311
291
  if (utils.matchContentType(contentType, "application/json")) {
312
- res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
313
- }
314
- else {
315
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
316
- }
317
- break;
318
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
319
- if (utils.matchContentType(contentType, "application/json")) {
320
- res.fourHundredAndFourError = JSON.parse(decodedRes);
321
- }
322
- else {
323
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
324
- }
325
- break;
326
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
327
- if (utils.matchContentType(contentType, "application/json")) {
328
- res.fourHundredAndNineError = JSON.parse(decodedRes);
329
- }
330
- else {
331
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
332
- }
333
- break;
334
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
335
- if (utils.matchContentType(contentType, "application/json")) {
336
- res.fourHundredAndThirteenError = JSON.parse(decodedRes);
292
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
293
+ err.rawResponse = httpRes;
294
+ throw new errors.FourHundredAndOneError(err);
337
295
  }
338
296
  else {
339
297
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -341,7 +299,9 @@ var Plan = /** @class */ (function () {
341
299
  break;
342
300
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
343
301
  if (utils.matchContentType(contentType, "application/json")) {
344
- res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
302
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
303
+ err.rawResponse = httpRes;
304
+ throw new errors.FourHundredAndTwentyNineError(err);
345
305
  }
346
306
  else {
347
307
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -349,7 +309,9 @@ var Plan = /** @class */ (function () {
349
309
  break;
350
310
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
351
311
  if (utils.matchContentType(contentType, "application/json")) {
352
- res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
312
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
313
+ err.rawResponse = httpRes;
314
+ throw new errors.FiveHundredError(err);
353
315
  }
354
316
  else {
355
317
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -378,7 +340,7 @@ var Plan = /** @class */ (function () {
378
340
  Plan.prototype.fetchByExternalId = function (externalPlanId, config) {
379
341
  var _a, _b;
380
342
  return __awaiter(this, void 0, void 0, function () {
381
- var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
343
+ var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
382
344
  return __generator(this, function (_c) {
383
345
  switch (_c.label) {
384
346
  case 0:
@@ -424,41 +386,18 @@ var Plan = /** @class */ (function () {
424
386
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
425
387
  }
426
388
  break;
427
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
428
- if (utils.matchContentType(contentType, "application/json")) {
429
- res.fourHundredError = JSON.parse(decodedRes);
430
- }
431
- else {
432
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
433
- }
434
- break;
389
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
390
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
391
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
392
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
393
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
394
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
395
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
435
396
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
436
397
  if (utils.matchContentType(contentType, "application/json")) {
437
- res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
438
- }
439
- else {
440
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
441
- }
442
- break;
443
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
444
- if (utils.matchContentType(contentType, "application/json")) {
445
- res.fourHundredAndFourError = JSON.parse(decodedRes);
446
- }
447
- else {
448
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
449
- }
450
- break;
451
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
452
- if (utils.matchContentType(contentType, "application/json")) {
453
- res.fourHundredAndNineError = JSON.parse(decodedRes);
454
- }
455
- else {
456
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
457
- }
458
- break;
459
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
460
- if (utils.matchContentType(contentType, "application/json")) {
461
- res.fourHundredAndThirteenError = JSON.parse(decodedRes);
398
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
399
+ err.rawResponse = httpRes;
400
+ throw new errors.FourHundredAndOneError(err);
462
401
  }
463
402
  else {
464
403
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -466,7 +405,9 @@ var Plan = /** @class */ (function () {
466
405
  break;
467
406
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
468
407
  if (utils.matchContentType(contentType, "application/json")) {
469
- res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
408
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
409
+ err.rawResponse = httpRes;
410
+ throw new errors.FourHundredAndTwentyNineError(err);
470
411
  }
471
412
  else {
472
413
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -474,7 +415,9 @@ var Plan = /** @class */ (function () {
474
415
  break;
475
416
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
476
417
  if (utils.matchContentType(contentType, "application/json")) {
477
- res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
418
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
419
+ err.rawResponse = httpRes;
420
+ throw new errors.FiveHundredError(err);
478
421
  }
479
422
  else {
480
423
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -498,7 +441,7 @@ var Plan = /** @class */ (function () {
498
441
  Plan.prototype.list = function (req, config) {
499
442
  var _a, _b;
500
443
  return __awaiter(this, void 0, void 0, function () {
501
- var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
444
+ var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
502
445
  return __generator(this, function (_c) {
503
446
  switch (_c.label) {
504
447
  case 0:
@@ -545,41 +488,18 @@ var Plan = /** @class */ (function () {
545
488
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
546
489
  }
547
490
  break;
548
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
549
- if (utils.matchContentType(contentType, "application/json")) {
550
- res.fourHundredError = JSON.parse(decodedRes);
551
- }
552
- else {
553
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
554
- }
555
- break;
491
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
492
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
493
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
494
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
495
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
496
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
497
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
556
498
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
557
499
  if (utils.matchContentType(contentType, "application/json")) {
558
- res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
559
- }
560
- else {
561
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
562
- }
563
- break;
564
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
565
- if (utils.matchContentType(contentType, "application/json")) {
566
- res.fourHundredAndFourError = JSON.parse(decodedRes);
567
- }
568
- else {
569
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
570
- }
571
- break;
572
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
573
- if (utils.matchContentType(contentType, "application/json")) {
574
- res.fourHundredAndNineError = JSON.parse(decodedRes);
575
- }
576
- else {
577
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
578
- }
579
- break;
580
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
581
- if (utils.matchContentType(contentType, "application/json")) {
582
- res.fourHundredAndThirteenError = JSON.parse(decodedRes);
500
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
501
+ err.rawResponse = httpRes;
502
+ throw new errors.FourHundredAndOneError(err);
583
503
  }
584
504
  else {
585
505
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -587,7 +507,9 @@ var Plan = /** @class */ (function () {
587
507
  break;
588
508
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
589
509
  if (utils.matchContentType(contentType, "application/json")) {
590
- res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
510
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
511
+ err.rawResponse = httpRes;
512
+ throw new errors.FourHundredAndTwentyNineError(err);
591
513
  }
592
514
  else {
593
515
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -595,7 +517,9 @@ var Plan = /** @class */ (function () {
595
517
  break;
596
518
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
597
519
  if (utils.matchContentType(contentType, "application/json")) {
598
- res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
520
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
521
+ err.rawResponse = httpRes;
522
+ throw new errors.FiveHundredError(err);
599
523
  }
600
524
  else {
601
525
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -618,7 +542,7 @@ var Plan = /** @class */ (function () {
618
542
  Plan.prototype.updatePlan = function (planId, editPlan, config) {
619
543
  var _a, _b;
620
544
  return __awaiter(this, void 0, void 0, function () {
621
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
545
+ var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
622
546
  var _d;
623
547
  return __generator(this, function (_e) {
624
548
  switch (_e.label) {
@@ -675,41 +599,18 @@ var Plan = /** @class */ (function () {
675
599
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
676
600
  }
677
601
  break;
678
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
679
- if (utils.matchContentType(contentType, "application/json")) {
680
- res.fourHundredError = JSON.parse(decodedRes);
681
- }
682
- else {
683
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
684
- }
685
- break;
602
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
603
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
604
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
605
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
606
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
607
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
608
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
686
609
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
687
610
  if (utils.matchContentType(contentType, "application/json")) {
688
- res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
689
- }
690
- else {
691
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
692
- }
693
- break;
694
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
695
- if (utils.matchContentType(contentType, "application/json")) {
696
- res.fourHundredAndFourError = JSON.parse(decodedRes);
697
- }
698
- else {
699
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
700
- }
701
- break;
702
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
703
- if (utils.matchContentType(contentType, "application/json")) {
704
- res.fourHundredAndNineError = JSON.parse(decodedRes);
705
- }
706
- else {
707
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
708
- }
709
- break;
710
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
711
- if (utils.matchContentType(contentType, "application/json")) {
712
- res.fourHundredAndThirteenError = JSON.parse(decodedRes);
611
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
612
+ err.rawResponse = httpRes;
613
+ throw new errors.FourHundredAndOneError(err);
713
614
  }
714
615
  else {
715
616
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -717,7 +618,9 @@ var Plan = /** @class */ (function () {
717
618
  break;
718
619
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
719
620
  if (utils.matchContentType(contentType, "application/json")) {
720
- res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
621
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
622
+ err.rawResponse = httpRes;
623
+ throw new errors.FourHundredAndTwentyNineError(err);
721
624
  }
722
625
  else {
723
626
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -725,7 +628,9 @@ var Plan = /** @class */ (function () {
725
628
  break;
726
629
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
727
630
  if (utils.matchContentType(contentType, "application/json")) {
728
- res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
631
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
632
+ err.rawResponse = httpRes;
633
+ throw new errors.FiveHundredError(err);
729
634
  }
730
635
  else {
731
636
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -754,7 +659,7 @@ var Plan = /** @class */ (function () {
754
659
  Plan.prototype.updatePlanExternal = function (externalPlanId, editPlan, config) {
755
660
  var _a, _b;
756
661
  return __awaiter(this, void 0, void 0, function () {
757
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
662
+ var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
758
663
  var _d;
759
664
  return __generator(this, function (_e) {
760
665
  switch (_e.label) {
@@ -811,41 +716,18 @@ var Plan = /** @class */ (function () {
811
716
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
812
717
  }
813
718
  break;
814
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
815
- if (utils.matchContentType(contentType, "application/json")) {
816
- res.fourHundredError = JSON.parse(decodedRes);
817
- }
818
- else {
819
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
820
- }
821
- break;
719
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
720
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
721
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
722
+ (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
723
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
724
+ ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
725
+ throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
822
726
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
823
727
  if (utils.matchContentType(contentType, "application/json")) {
824
- res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
825
- }
826
- else {
827
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
828
- }
829
- break;
830
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
831
- if (utils.matchContentType(contentType, "application/json")) {
832
- res.fourHundredAndFourError = JSON.parse(decodedRes);
833
- }
834
- else {
835
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
836
- }
837
- break;
838
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
839
- if (utils.matchContentType(contentType, "application/json")) {
840
- res.fourHundredAndNineError = JSON.parse(decodedRes);
841
- }
842
- else {
843
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
844
- }
845
- break;
846
- case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
847
- if (utils.matchContentType(contentType, "application/json")) {
848
- res.fourHundredAndThirteenError = JSON.parse(decodedRes);
728
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
729
+ err.rawResponse = httpRes;
730
+ throw new errors.FourHundredAndOneError(err);
849
731
  }
850
732
  else {
851
733
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -853,7 +735,9 @@ var Plan = /** @class */ (function () {
853
735
  break;
854
736
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
855
737
  if (utils.matchContentType(contentType, "application/json")) {
856
- res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
738
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
739
+ err.rawResponse = httpRes;
740
+ throw new errors.FourHundredAndTwentyNineError(err);
857
741
  }
858
742
  else {
859
743
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
@@ -861,7 +745,9 @@ var Plan = /** @class */ (function () {
861
745
  break;
862
746
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
863
747
  if (utils.matchContentType(contentType, "application/json")) {
864
- res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
748
+ err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
749
+ err.rawResponse = httpRes;
750
+ throw new errors.FiveHundredError(err);
865
751
  }
866
752
  else {
867
753
  throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);