orb-billing 1.20.0 → 1.20.2
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.
- package/README.md +1 -1
- package/dist/sdk/availability.js +17 -36
- package/dist/sdk/coupon.js +85 -180
- package/dist/sdk/credit.js +102 -216
- package/dist/sdk/creditnote.js +34 -72
- package/dist/sdk/customer.js +221 -468
- package/dist/sdk/event.js +153 -324
- package/dist/sdk/invoice.js +136 -288
- package/dist/sdk/item.js +34 -72
- package/dist/sdk/metric.js +51 -108
- package/dist/sdk/models/errors/fivehundrederror.d.ts +11 -0
- package/dist/sdk/models/{shared → errors}/fivehundrederror.js +21 -11
- package/dist/sdk/models/errors/fourhundredandoneerror.d.ts +11 -0
- package/dist/sdk/models/{shared → errors}/fourhundredandoneerror.js +21 -15
- package/dist/sdk/models/errors/fourhundredandtwentynineerror.d.ts +11 -0
- package/dist/sdk/models/{shared → errors}/fourhundredandtwentynineerror.js +21 -15
- package/dist/sdk/models/errors/index.d.ts +3 -0
- package/dist/sdk/models/errors/index.js +3 -0
- package/dist/sdk/models/operations/addeditpriceintervals.d.ts +0 -28
- package/dist/sdk/models/operations/addeditpriceintervals.js +0 -28
- package/dist/sdk/models/operations/amendevent.d.ts +0 -28
- package/dist/sdk/models/operations/amendevent.js +0 -28
- package/dist/sdk/models/operations/amendusage.d.ts +0 -28
- package/dist/sdk/models/operations/amendusage.js +0 -28
- package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +0 -28
- package/dist/sdk/models/operations/amendusageexternalcustomerid.js +0 -28
- package/dist/sdk/models/operations/archivecoupon.d.ts +0 -28
- package/dist/sdk/models/operations/archivecoupon.js +0 -28
- package/dist/sdk/models/operations/cancelsubscription.d.ts +0 -28
- package/dist/sdk/models/operations/cancelsubscription.js +0 -28
- package/dist/sdk/models/operations/closebackfill.d.ts +0 -28
- package/dist/sdk/models/operations/closebackfill.js +0 -28
- package/dist/sdk/models/operations/createbackfill.d.ts +0 -28
- package/dist/sdk/models/operations/createbackfill.js +0 -28
- package/dist/sdk/models/operations/createcoupon.d.ts +0 -28
- package/dist/sdk/models/operations/createcoupon.js +0 -28
- package/dist/sdk/models/operations/createcustomer.d.ts +0 -28
- package/dist/sdk/models/operations/createcustomer.js +0 -28
- package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +0 -28
- package/dist/sdk/models/operations/createcustomerbalancetransaction.js +0 -28
- package/dist/sdk/models/operations/createinvoice.d.ts +0 -28
- package/dist/sdk/models/operations/createinvoice.js +0 -28
- package/dist/sdk/models/operations/createinvoicelineitem.d.ts +0 -28
- package/dist/sdk/models/operations/createinvoicelineitem.js +0 -28
- package/dist/sdk/models/operations/createledgerentry.d.ts +0 -29
- package/dist/sdk/models/operations/createledgerentry.js +0 -52
- package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +0 -29
- package/dist/sdk/models/operations/createledgerentryexternalid.js +0 -52
- package/dist/sdk/models/operations/createmetric.d.ts +0 -28
- package/dist/sdk/models/operations/createmetric.js +0 -28
- package/dist/sdk/models/operations/createplan.d.ts +0 -28
- package/dist/sdk/models/operations/createplan.js +0 -28
- package/dist/sdk/models/operations/createprice.d.ts +0 -29
- package/dist/sdk/models/operations/createprice.js +0 -52
- package/dist/sdk/models/operations/createsubscription.d.ts +0 -28
- package/dist/sdk/models/operations/createsubscription.js +0 -28
- package/dist/sdk/models/operations/deletecustomer.d.ts +0 -28
- package/dist/sdk/models/operations/deletecustomer.js +0 -28
- package/dist/sdk/models/operations/deprecateevent.d.ts +0 -28
- package/dist/sdk/models/operations/deprecateevent.js +0 -28
- package/dist/sdk/models/operations/fetchbackfill.d.ts +0 -28
- package/dist/sdk/models/operations/fetchbackfill.js +0 -28
- package/dist/sdk/models/operations/fetchcoupon.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcoupon.js +0 -28
- package/dist/sdk/models/operations/fetchcreditnote.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcreditnote.js +0 -28
- package/dist/sdk/models/operations/fetchcustomer.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomer.js +0 -28
- package/dist/sdk/models/operations/fetchcustomercosts.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomercosts.js +0 -28
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +0 -28
- package/dist/sdk/models/operations/fetchcustomercredits.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomercredits.js +0 -28
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +0 -28
- package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomercreditsledger.js +0 -28
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +0 -28
- package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +0 -28
- package/dist/sdk/models/operations/fetchcustomerexternalid.js +0 -28
- package/dist/sdk/models/operations/fetchinvoice.d.ts +0 -28
- package/dist/sdk/models/operations/fetchinvoice.js +0 -28
- package/dist/sdk/models/operations/fetchitem.d.ts +0 -28
- package/dist/sdk/models/operations/fetchitem.js +0 -28
- package/dist/sdk/models/operations/fetchmetric.d.ts +0 -28
- package/dist/sdk/models/operations/fetchmetric.js +0 -28
- package/dist/sdk/models/operations/fetchplan.d.ts +0 -28
- package/dist/sdk/models/operations/fetchplan.js +0 -28
- package/dist/sdk/models/operations/fetchplanexternalid.d.ts +0 -28
- package/dist/sdk/models/operations/fetchplanexternalid.js +0 -28
- package/dist/sdk/models/operations/fetchprice.d.ts +0 -29
- package/dist/sdk/models/operations/fetchprice.js +0 -52
- package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +0 -29
- package/dist/sdk/models/operations/fetchpriceexternalid.js +0 -52
- package/dist/sdk/models/operations/fetchsubscription.d.ts +0 -28
- package/dist/sdk/models/operations/fetchsubscription.js +0 -28
- package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +0 -28
- package/dist/sdk/models/operations/fetchsubscriptioncosts.js +0 -28
- package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +0 -28
- package/dist/sdk/models/operations/fetchsubscriptionschedule.js +0 -28
- package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +0 -29
- package/dist/sdk/models/operations/fetchsubscriptionusage.js +0 -52
- package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +0 -28
- package/dist/sdk/models/operations/fetchupcominginvoice.js +0 -28
- package/dist/sdk/models/operations/ingest.d.ts +0 -28
- package/dist/sdk/models/operations/ingest.js +0 -28
- package/dist/sdk/models/operations/issueinvoice.d.ts +0 -28
- package/dist/sdk/models/operations/issueinvoice.js +0 -28
- package/dist/sdk/models/operations/listbackfills.d.ts +0 -28
- package/dist/sdk/models/operations/listbackfills.js +0 -28
- package/dist/sdk/models/operations/listbalancetransactions.d.ts +0 -28
- package/dist/sdk/models/operations/listbalancetransactions.js +0 -28
- package/dist/sdk/models/operations/listcoupons.d.ts +0 -28
- package/dist/sdk/models/operations/listcoupons.js +0 -28
- package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +0 -28
- package/dist/sdk/models/operations/listcouponsubscriptions.js +0 -28
- package/dist/sdk/models/operations/listcreditnotes.d.ts +0 -28
- package/dist/sdk/models/operations/listcreditnotes.js +0 -28
- package/dist/sdk/models/operations/listcustomers.d.ts +0 -28
- package/dist/sdk/models/operations/listcustomers.js +0 -28
- package/dist/sdk/models/operations/listinvoices.d.ts +0 -28
- package/dist/sdk/models/operations/listinvoices.js +0 -28
- package/dist/sdk/models/operations/listitems.d.ts +0 -28
- package/dist/sdk/models/operations/listitems.js +0 -28
- package/dist/sdk/models/operations/listmetrics.d.ts +0 -28
- package/dist/sdk/models/operations/listmetrics.js +0 -28
- package/dist/sdk/models/operations/listplans.d.ts +0 -28
- package/dist/sdk/models/operations/listplans.js +0 -28
- package/dist/sdk/models/operations/listprices.d.ts +0 -28
- package/dist/sdk/models/operations/listprices.js +0 -28
- package/dist/sdk/models/operations/listsubscriptions.d.ts +0 -28
- package/dist/sdk/models/operations/listsubscriptions.js +0 -28
- package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +0 -28
- package/dist/sdk/models/operations/markinvoiceaspaid.js +0 -28
- package/dist/sdk/models/operations/ping.d.ts +0 -28
- package/dist/sdk/models/operations/ping.js +0 -28
- package/dist/sdk/models/operations/revertbackfill.d.ts +0 -28
- package/dist/sdk/models/operations/revertbackfill.js +0 -28
- package/dist/sdk/models/operations/scheduleplanchange.d.ts +0 -28
- package/dist/sdk/models/operations/scheduleplanchange.js +0 -28
- package/dist/sdk/models/operations/searchevents.d.ts +0 -28
- package/dist/sdk/models/operations/searchevents.js +0 -28
- package/dist/sdk/models/operations/triggerphase.d.ts +0 -28
- package/dist/sdk/models/operations/triggerphase.js +0 -28
- package/dist/sdk/models/operations/unschedulecancellation.d.ts +0 -28
- package/dist/sdk/models/operations/unschedulecancellation.js +0 -28
- package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +0 -28
- package/dist/sdk/models/operations/unschedulefixedfeequantity.js +0 -28
- package/dist/sdk/models/operations/unscheduleplanchange.d.ts +0 -28
- package/dist/sdk/models/operations/unscheduleplanchange.js +0 -28
- package/dist/sdk/models/operations/updatecustomer.d.ts +0 -28
- package/dist/sdk/models/operations/updatecustomer.js +0 -28
- package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +0 -28
- package/dist/sdk/models/operations/updatecustomerexternalid.js +0 -28
- package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +0 -28
- package/dist/sdk/models/operations/updatefixedfeequantity.js +0 -28
- package/dist/sdk/models/operations/updateplan.d.ts +0 -28
- package/dist/sdk/models/operations/updateplan.js +0 -28
- package/dist/sdk/models/operations/updateplanexternal.d.ts +0 -28
- package/dist/sdk/models/operations/updateplanexternal.js +0 -28
- package/dist/sdk/models/operations/voidinvoice.d.ts +0 -28
- package/dist/sdk/models/operations/voidinvoice.js +0 -28
- package/dist/sdk/models/shared/index.d.ts +0 -3
- package/dist/sdk/models/shared/index.js +0 -3
- package/dist/sdk/models/shared/security.d.ts +1 -1
- package/dist/sdk/models/shared/security.js +1 -1
- package/dist/sdk/plan.js +102 -216
- package/dist/sdk/price.js +68 -144
- package/dist/sdk/priceinterval.js +17 -36
- package/dist/sdk/sdk.js +2 -2
- package/dist/sdk/subscription.js +221 -468
- package/docs/models/errors/fivehundrederror.md +12 -0
- package/docs/models/errors/fourhundredandoneerror.md +12 -0
- package/docs/models/errors/fourhundredandtwentynineerror.md +12 -0
- package/docs/models/operations/addeditpriceintervalsresponse.md +6 -13
- package/docs/models/operations/amendeventresponse.md +6 -13
- package/docs/models/operations/amendusageexternalcustomeridresponse.md +6 -13
- package/docs/models/operations/amendusageresponse.md +6 -13
- package/docs/models/operations/archivecouponresponse.md +6 -13
- package/docs/models/operations/cancelsubscriptionresponse.md +6 -13
- package/docs/models/operations/closebackfillresponse.md +6 -13
- package/docs/models/operations/createbackfillresponse.md +6 -13
- package/docs/models/operations/createcouponresponse.md +6 -13
- package/docs/models/operations/createcustomerbalancetransactionresponse.md +6 -13
- package/docs/models/operations/createcustomerresponse.md +6 -13
- package/docs/models/operations/createinvoicelineitemresponse.md +6 -13
- package/docs/models/operations/createinvoiceresponse.md +6 -13
- package/docs/models/operations/createledgerentryexternalidresponse.md +6 -13
- package/docs/models/operations/createledgerentryresponse.md +6 -13
- package/docs/models/operations/createmetricresponse.md +6 -13
- package/docs/models/operations/createplanresponse.md +6 -13
- package/docs/models/operations/createpriceresponse.md +6 -13
- package/docs/models/operations/createsubscriptionresponse.md +6 -13
- package/docs/models/operations/deletecustomerresponse.md +6 -13
- package/docs/models/operations/deprecateeventresponse.md +6 -13
- package/docs/models/operations/fetchbackfillresponse.md +6 -13
- package/docs/models/operations/fetchcouponresponse.md +6 -13
- package/docs/models/operations/fetchcreditnoteresponse.md +6 -13
- package/docs/models/operations/fetchcustomercostsexternalidresponse.md +6 -13
- package/docs/models/operations/fetchcustomercostsresponse.md +6 -13
- package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +6 -13
- package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +6 -13
- package/docs/models/operations/fetchcustomercreditsledgerresponse.md +6 -13
- package/docs/models/operations/fetchcustomercreditsresponse.md +6 -13
- package/docs/models/operations/fetchcustomerexternalidresponse.md +6 -13
- package/docs/models/operations/fetchcustomerresponse.md +6 -13
- package/docs/models/operations/fetchinvoiceresponse.md +6 -13
- package/docs/models/operations/fetchitemresponse.md +6 -13
- package/docs/models/operations/fetchmetricresponse.md +6 -13
- package/docs/models/operations/fetchplanexternalidresponse.md +6 -13
- package/docs/models/operations/fetchplanresponse.md +6 -13
- package/docs/models/operations/fetchpriceexternalidresponse.md +6 -13
- package/docs/models/operations/fetchpriceresponse.md +6 -13
- package/docs/models/operations/fetchsubscriptioncostsresponse.md +6 -13
- package/docs/models/operations/fetchsubscriptionresponse.md +6 -13
- package/docs/models/operations/fetchsubscriptionscheduleresponse.md +6 -13
- package/docs/models/operations/fetchsubscriptionusageresponse.md +6 -13
- package/docs/models/operations/fetchupcominginvoiceresponse.md +6 -13
- package/docs/models/operations/ingestresponse.md +6 -13
- package/docs/models/operations/issueinvoiceresponse.md +6 -13
- package/docs/models/operations/listbackfillsresponse.md +6 -13
- package/docs/models/operations/listbalancetransactionsresponse.md +6 -13
- package/docs/models/operations/listcouponsresponse.md +6 -13
- package/docs/models/operations/listcouponsubscriptionsresponse.md +6 -13
- package/docs/models/operations/listcreditnotesresponse.md +6 -13
- package/docs/models/operations/listcustomersresponse.md +6 -13
- package/docs/models/operations/listinvoicesresponse.md +6 -13
- package/docs/models/operations/listitemsresponse.md +6 -13
- package/docs/models/operations/listmetricsresponse.md +6 -13
- package/docs/models/operations/listplansresponse.md +6 -13
- package/docs/models/operations/listpricesresponse.md +6 -13
- package/docs/models/operations/listsubscriptionsresponse.md +6 -13
- package/docs/models/operations/markinvoiceaspaidresponse.md +6 -13
- package/docs/models/operations/pingresponse.md +6 -13
- package/docs/models/operations/revertbackfillresponse.md +6 -13
- package/docs/models/operations/scheduleplanchangeresponse.md +6 -13
- package/docs/models/operations/searcheventsresponse.md +6 -13
- package/docs/models/operations/triggerphaseresponse.md +6 -13
- package/docs/models/operations/unschedulecancellationresponse.md +6 -13
- package/docs/models/operations/unschedulefixedfeequantityresponse.md +6 -13
- package/docs/models/operations/unscheduleplanchangeresponse.md +6 -13
- package/docs/models/operations/updatecustomerexternalidresponse.md +6 -13
- package/docs/models/operations/updatecustomerresponse.md +6 -13
- package/docs/models/operations/updatefixedfeequantityresponse.md +6 -13
- package/docs/models/operations/updateplanexternalresponse.md +6 -13
- package/docs/models/operations/updateplanresponse.md +6 -13
- package/docs/models/operations/voidinvoiceresponse.md +6 -13
- package/docs/models/shared/security.md +1 -1
- package/docs/sdks/availability/README.md +1 -1
- package/docs/sdks/coupon/README.md +5 -5
- package/docs/sdks/credit/README.md +6 -6
- package/docs/sdks/creditnote/README.md +2 -2
- package/docs/sdks/customer/README.md +13 -13
- package/docs/sdks/event/README.md +9 -9
- package/docs/sdks/invoice/README.md +8 -8
- package/docs/sdks/item/README.md +2 -2
- package/docs/sdks/metric/README.md +3 -3
- package/docs/sdks/plan/README.md +6 -6
- package/docs/sdks/price/README.md +4 -4
- package/docs/sdks/priceinterval/README.md +1 -1
- package/docs/sdks/subscription/README.md +13 -13
- package/package.json +1 -1
- package/dist/sdk/models/shared/fivehundrederror.d.ts +0 -13
- package/dist/sdk/models/shared/fourhundredandoneerror.d.ts +0 -16
- package/dist/sdk/models/shared/fourhundredandtwentynineerror.d.ts +0 -16
- package/docs/models/shared/fivehundrederror.md +0 -12
- package/docs/models/shared/fivehundrederrortype.md +0 -8
- package/docs/models/shared/fourhundredandoneerror.md +0 -12
- package/docs/models/shared/fourhundredandoneerrorstatus.md +0 -8
- package/docs/models/shared/fourhundredandoneerrortype.md +0 -8
- package/docs/models/shared/fourhundredandtwentynineerror.md +0 -12
- package/docs/models/shared/fourhundredandtwentynineerrorstatus.md +0 -8
- package/docs/models/shared/fourhundredandtwentynineerrortype.md +0 -8
- /package/docs/models/{shared → errors}/fivehundrederrorheaders.md +0 -0
- /package/docs/models/{shared → errors}/fourhundredandoneerrorheaders.md +0 -0
- /package/docs/models/{shared → errors}/fourhundredandtwentynineerrorheaders.md +0 -0
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
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
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
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
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
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
|
-
|
|
689
|
-
|
|
690
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
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
|
-
|
|
825
|
-
|
|
826
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|