orb-billing 1.0.1 → 1.19.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -41
- package/dist/internal/utils/requestbody.d.ts +1 -1
- package/dist/internal/utils/requestbody.js +1 -1
- package/dist/internal/utils/retries.d.ts +2 -2
- package/dist/internal/utils/security.d.ts +5 -2
- package/dist/internal/utils/security.js +28 -28
- package/dist/internal/utils/utils.js +1 -1
- package/dist/sdk/availability.d.ts +3 -4
- package/dist/sdk/availability.js +80 -10
- package/dist/sdk/coupon.d.ts +16 -7
- package/dist/sdk/coupon.js +396 -35
- package/dist/sdk/credit.d.ts +242 -36
- package/dist/sdk/credit.js +704 -77
- package/dist/sdk/creditnote.d.ts +8 -5
- package/dist/sdk/creditnote.js +160 -16
- package/dist/sdk/customer.d.ts +358 -93
- package/dist/sdk/customer.js +1351 -189
- package/dist/sdk/event.d.ts +198 -103
- package/dist/sdk/event.js +906 -157
- package/dist/sdk/invoice.d.ts +39 -10
- package/dist/sdk/invoice.js +727 -47
- package/dist/sdk/item.d.ts +27 -0
- package/dist/sdk/item.js +328 -0
- package/dist/sdk/metric.d.ts +39 -0
- package/dist/sdk/metric.js +475 -0
- package/dist/sdk/models/errors/index.d.ts +1 -0
- package/dist/sdk/models/errors/index.js +20 -0
- package/dist/sdk/models/errors/sdkerror.d.ts +7 -0
- package/dist/sdk/models/errors/sdkerror.js +40 -0
- package/dist/sdk/models/operations/addeditpriceintervals.d.ts +53 -0
- package/dist/sdk/models/operations/addeditpriceintervals.js +123 -0
- package/dist/sdk/models/operations/amendevent.d.ts +35 -5
- package/dist/sdk/models/operations/amendevent.js +28 -4
- package/dist/sdk/models/operations/amendusage.d.ts +36 -15
- package/dist/sdk/models/operations/amendusage.js +31 -22
- package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +36 -15
- package/dist/sdk/models/operations/amendusageexternalcustomerid.js +31 -22
- package/dist/sdk/models/operations/archivecoupon.d.ts +37 -0
- package/dist/sdk/models/operations/archivecoupon.js +28 -0
- package/dist/sdk/models/operations/cancelsubscription.d.ts +38 -1
- package/dist/sdk/models/operations/cancelsubscription.js +30 -2
- package/dist/sdk/models/operations/closebackfill.d.ts +37 -0
- package/dist/sdk/models/operations/closebackfill.js +28 -0
- package/dist/sdk/models/operations/createbackfill.d.ts +37 -0
- package/dist/sdk/models/operations/createbackfill.js +28 -0
- package/dist/sdk/models/operations/createcoupon.d.ts +38 -1
- package/dist/sdk/models/operations/createcoupon.js +28 -0
- package/dist/sdk/models/operations/createcustomer.d.ts +37 -0
- package/dist/sdk/models/operations/createcustomer.js +28 -0
- package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +38 -1
- package/dist/sdk/models/operations/createcustomerbalancetransaction.js +30 -2
- package/dist/sdk/models/operations/createinvoice.d.ts +49 -0
- package/dist/sdk/models/operations/createinvoice.js +107 -0
- package/dist/sdk/models/operations/createinvoicelineitem.d.ts +37 -0
- package/dist/sdk/models/operations/createinvoicelineitem.js +28 -0
- package/dist/sdk/models/operations/createledgerentry.d.ts +40 -3
- package/dist/sdk/models/operations/createledgerentry.js +31 -3
- package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +53 -0
- package/dist/sdk/models/operations/createledgerentryexternalid.js +123 -0
- package/dist/sdk/models/operations/createmetric.d.ts +49 -0
- package/dist/sdk/models/operations/createmetric.js +107 -0
- package/dist/sdk/models/operations/createplan.d.ts +49 -0
- package/dist/sdk/models/operations/createplan.js +107 -0
- package/dist/sdk/models/operations/createprice.d.ts +49 -0
- package/dist/sdk/models/operations/{addledgerentryexternalid.js → createprice.js} +37 -25
- package/dist/sdk/models/operations/createsubscription.d.ts +38 -1
- package/dist/sdk/models/operations/createsubscription.js +28 -0
- package/dist/sdk/models/operations/deletecustomer.d.ts +41 -11
- package/dist/sdk/models/operations/deletecustomer.js +57 -16
- package/dist/sdk/models/operations/deprecateevent.d.ts +35 -5
- package/dist/sdk/models/operations/deprecateevent.js +28 -4
- package/dist/sdk/models/operations/fetchbackfill.d.ts +52 -0
- package/dist/sdk/models/operations/fetchbackfill.js +119 -0
- package/dist/sdk/models/operations/fetchcoupon.d.ts +37 -0
- package/dist/sdk/models/operations/fetchcoupon.js +28 -0
- package/dist/sdk/models/operations/fetchcreditnote.d.ts +37 -3
- package/dist/sdk/models/operations/fetchcreditnote.js +28 -0
- package/dist/sdk/models/operations/fetchcustomer.d.ts +38 -4
- package/dist/sdk/models/operations/fetchcustomer.js +28 -0
- package/dist/sdk/models/operations/fetchcustomercosts.d.ts +44 -12
- package/dist/sdk/models/operations/fetchcustomercosts.js +37 -1
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +45 -10
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +37 -1
- package/dist/sdk/models/operations/fetchcustomercredits.d.ts +37 -9
- package/dist/sdk/models/operations/fetchcustomercredits.js +31 -3
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +39 -8
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +31 -3
- package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +53 -13
- package/dist/sdk/models/operations/fetchcustomercreditsledger.js +66 -3
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +53 -13
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +66 -3
- package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +37 -0
- package/dist/sdk/models/operations/fetchcustomerexternalid.js +28 -0
- package/dist/sdk/models/operations/fetchinvoice.d.ts +37 -0
- package/dist/sdk/models/operations/fetchinvoice.js +28 -0
- package/dist/sdk/models/operations/fetchitem.d.ts +52 -0
- package/dist/sdk/models/operations/fetchitem.js +119 -0
- package/dist/sdk/models/operations/fetchmetric.d.ts +52 -0
- package/dist/sdk/models/operations/fetchmetric.js +119 -0
- package/dist/sdk/models/operations/fetchplan.d.ts +37 -0
- package/dist/sdk/models/operations/fetchplan.js +28 -0
- package/dist/sdk/models/operations/fetchplanexternalid.d.ts +37 -0
- package/dist/sdk/models/operations/fetchplanexternalid.js +28 -0
- package/dist/sdk/models/operations/fetchprice.d.ts +52 -0
- package/dist/sdk/models/operations/fetchprice.js +119 -0
- package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +52 -0
- package/dist/sdk/models/operations/fetchpriceexternalid.js +119 -0
- package/dist/sdk/models/operations/fetchsubscription.d.ts +37 -0
- package/dist/sdk/models/operations/fetchsubscription.js +28 -0
- package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +45 -10
- package/dist/sdk/models/operations/fetchsubscriptioncosts.js +37 -1
- package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +43 -8
- package/dist/sdk/models/operations/fetchsubscriptionschedule.js +47 -3
- package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +60 -16
- package/dist/sdk/models/operations/fetchsubscriptionusage.js +69 -2
- package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +38 -1
- package/dist/sdk/models/operations/fetchupcominginvoice.js +28 -0
- package/dist/sdk/models/operations/index.d.ts +20 -2
- package/dist/sdk/models/operations/index.js +20 -2
- package/dist/sdk/models/operations/ingest.d.ts +36 -12
- package/dist/sdk/models/operations/ingest.js +31 -22
- package/dist/sdk/models/operations/issueinvoice.d.ts +35 -2
- package/dist/sdk/models/operations/issueinvoice.js +28 -4
- package/dist/sdk/models/operations/listbackfills.d.ts +37 -6
- package/dist/sdk/models/operations/listbackfills.js +29 -1
- package/dist/sdk/models/operations/listbalancetransactions.d.ts +45 -10
- package/dist/sdk/models/operations/listbalancetransactions.js +49 -5
- package/dist/sdk/models/operations/listcoupons.d.ts +35 -10
- package/dist/sdk/models/operations/listcoupons.js +29 -1
- package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +39 -0
- package/dist/sdk/models/operations/listcouponsubscriptions.js +36 -0
- package/dist/sdk/models/operations/listcreditnotes.d.ts +53 -0
- package/dist/sdk/models/operations/listcreditnotes.js +123 -0
- package/dist/sdk/models/operations/listcustomers.d.ts +41 -6
- package/dist/sdk/models/operations/listcustomers.js +45 -1
- package/dist/sdk/models/operations/listinvoices.d.ts +66 -14
- package/dist/sdk/models/operations/listinvoices.js +109 -3
- package/dist/sdk/models/operations/listitems.d.ts +53 -0
- package/dist/sdk/models/operations/{listcreditnote.js → listitems.js} +46 -30
- package/dist/sdk/models/operations/listmetrics.d.ts +57 -0
- package/dist/sdk/models/operations/listmetrics.js +139 -0
- package/dist/sdk/models/operations/listplans.d.ts +53 -6
- package/dist/sdk/models/operations/listplans.js +59 -2
- package/dist/sdk/models/operations/listprices.d.ts +53 -0
- package/dist/sdk/models/operations/listprices.js +123 -0
- package/dist/sdk/models/operations/listsubscriptions.d.ts +48 -7
- package/dist/sdk/models/operations/listsubscriptions.js +56 -2
- package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +53 -0
- package/dist/sdk/models/operations/markinvoiceaspaid.js +123 -0
- package/dist/sdk/models/operations/ping.d.ts +39 -2
- package/dist/sdk/models/operations/ping.js +30 -2
- package/dist/sdk/models/operations/revertbackfill.d.ts +37 -0
- package/dist/sdk/models/operations/revertbackfill.js +28 -0
- package/dist/sdk/models/operations/scheduleplanchange.d.ts +37 -0
- package/dist/sdk/models/operations/scheduleplanchange.js +28 -0
- package/dist/sdk/models/operations/searchevents.d.ts +42 -7
- package/dist/sdk/models/operations/searchevents.js +47 -3
- package/dist/sdk/models/operations/triggerphase.d.ts +53 -0
- package/dist/sdk/models/operations/triggerphase.js +123 -0
- package/dist/sdk/models/operations/unschedulecancellation.d.ts +37 -0
- package/dist/sdk/models/operations/unschedulecancellation.js +28 -0
- package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +53 -0
- package/dist/sdk/models/operations/unschedulefixedfeequantity.js +123 -0
- package/dist/sdk/models/operations/unscheduleplanchange.d.ts +37 -0
- package/dist/sdk/models/operations/unscheduleplanchange.js +28 -0
- package/dist/sdk/models/operations/updatecustomer.d.ts +38 -4
- package/dist/sdk/models/operations/updatecustomer.js +30 -2
- package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +38 -1
- package/dist/sdk/models/operations/updatecustomerexternalid.js +30 -2
- package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +37 -0
- package/dist/sdk/models/operations/updatefixedfeequantity.js +28 -0
- package/dist/sdk/models/operations/updateplan.d.ts +53 -0
- package/dist/sdk/models/operations/updateplan.js +123 -0
- package/dist/sdk/models/operations/updateplanexternal.d.ts +53 -0
- package/dist/sdk/models/operations/updateplanexternal.js +123 -0
- package/dist/sdk/models/operations/voidinvoice.d.ts +36 -3
- package/dist/sdk/models/operations/voidinvoice.js +28 -4
- package/dist/sdk/models/shared/accountingprovider.d.ts +9 -0
- package/dist/sdk/models/shared/accountingprovider.js +55 -0
- package/dist/sdk/models/shared/accountingproviderconfig.d.ts +5 -0
- package/dist/sdk/models/shared/{creditblock.js → accountingproviderconfig.js} +10 -18
- package/dist/sdk/models/shared/accountingsyncconfiguration.d.ts +6 -0
- package/dist/sdk/models/shared/accountingsyncconfiguration.js +52 -0
- package/dist/sdk/models/shared/addamendmentcreditledgerentryrequestparams.d.ts +28 -0
- package/dist/sdk/models/shared/addamendmentcreditledgerentryrequestparams.js +81 -0
- package/dist/sdk/models/shared/adddecrementcreditledgerentryrequestparams.d.ts +24 -0
- package/dist/sdk/models/shared/adddecrementcreditledgerentryrequestparams.js +76 -0
- package/dist/sdk/models/shared/addeditpriceintervalparams.d.ts +13 -0
- package/dist/sdk/models/shared/addeditpriceintervalparams.js +54 -0
- package/dist/sdk/models/shared/addexpirationchangecreditledgerentryrequestparams.d.ts +37 -0
- package/dist/sdk/models/shared/{newcreditledgerentry.js → addexpirationchangecreditledgerentryrequestparams.js} +27 -34
- package/dist/sdk/models/shared/addincrementcreditledgerentryrequestparams.d.ts +42 -0
- package/dist/sdk/models/shared/addincrementcreditledgerentryrequestparams.js +109 -0
- package/dist/sdk/models/shared/addpriceintervalparams.d.ts +54 -0
- package/dist/sdk/models/shared/addpriceintervalparams.js +103 -0
- package/dist/sdk/models/shared/address.d.ts +9 -0
- package/dist/sdk/models/shared/address.js +70 -0
- package/dist/sdk/models/shared/addressinput.d.ts +9 -0
- package/dist/sdk/models/shared/addressinput.js +70 -0
- package/dist/sdk/models/shared/addvoidcreditledgerentryrequestparams.d.ts +38 -0
- package/dist/sdk/models/shared/addvoidcreditledgerentryrequestparams.js +93 -0
- package/dist/sdk/models/shared/affectedblock.d.ts +6 -0
- package/dist/sdk/models/shared/{credit.js → affectedblock.js} +9 -14
- package/dist/sdk/models/shared/{subscriptioncost.d.ts → aggregatedcost.d.ts} +1 -1
- package/dist/sdk/models/shared/{customercost.js → aggregatedcost.js} +11 -11
- package/dist/sdk/models/shared/amendedusage.d.ts +2 -7
- package/dist/sdk/models/shared/amendedusage.js +2 -14
- package/dist/sdk/models/shared/amendeventresult.d.ts +1 -4
- package/dist/sdk/models/shared/amendeventresult.js +0 -3
- package/dist/sdk/models/shared/amendmentledgerentry.d.ts +27 -0
- package/dist/sdk/models/shared/amendmentledgerentry.js +120 -0
- package/dist/sdk/models/shared/amountdiscount.d.ts +15 -0
- package/dist/sdk/models/shared/amountdiscount.js +59 -0
- package/dist/sdk/models/shared/amountdiscountcreationparams.d.ts +11 -0
- package/dist/sdk/models/shared/amountdiscountcreationparams.js +54 -0
- package/dist/sdk/models/shared/amountdiscountinterval.d.ts +27 -0
- package/dist/sdk/models/shared/amountdiscountinterval.js +82 -0
- package/dist/sdk/models/shared/autocollection.d.ts +3 -6
- package/dist/sdk/models/shared/autocollection.js +0 -3
- package/dist/sdk/models/shared/backfill.d.ts +2 -2
- package/dist/sdk/models/shared/backfills.d.ts +2 -5
- package/dist/sdk/models/shared/backfills.js +0 -3
- package/dist/sdk/models/shared/billablemetric.d.ts +24 -1
- package/dist/sdk/models/shared/billablemetric.js +40 -1
- package/dist/sdk/models/shared/billablemetrics.d.ts +7 -0
- package/dist/sdk/models/shared/billablemetrics.js +54 -0
- package/dist/sdk/models/shared/billablemetricsimple.d.ts +5 -0
- package/dist/sdk/models/shared/{billablemetricminified.js → billablemetricsimple.js} +8 -8
- package/dist/sdk/models/shared/billablemetrictiny.d.ts +4 -0
- package/dist/sdk/models/shared/billablemetrictiny.js +45 -0
- package/dist/sdk/models/shared/billingcyclealignment.d.ts +8 -0
- package/dist/sdk/models/shared/billingcyclealignment.js +15 -0
- package/dist/sdk/models/shared/bpsconfig.d.ts +7 -4
- package/dist/sdk/models/shared/bpsconfig.js +1 -4
- package/dist/sdk/models/shared/bpsprice.d.ts +242 -0
- package/dist/sdk/models/shared/bpsprice.js +363 -0
- package/dist/sdk/models/shared/bpstier.d.ts +15 -3
- package/dist/sdk/models/shared/bpstier.js +1 -1
- package/dist/sdk/models/shared/bulkbpsconfig.d.ts +4 -4
- package/dist/sdk/models/shared/bulkbpsconfig.js +0 -3
- package/dist/sdk/models/shared/bulkbpsprice.d.ts +242 -0
- package/dist/sdk/models/shared/bulkbpsprice.js +363 -0
- package/dist/sdk/models/shared/bulkbpstier.d.ts +10 -1
- package/dist/sdk/models/shared/bulkbpstier.js +1 -1
- package/dist/sdk/models/shared/bulkconfig.d.ts +4 -4
- package/dist/sdk/models/shared/bulkconfig.js +0 -3
- package/dist/sdk/models/shared/bulkprice.d.ts +242 -0
- package/dist/sdk/models/shared/bulkprice.js +363 -0
- package/dist/sdk/models/shared/bulktier.d.ts +7 -1
- package/dist/sdk/models/shared/bulktier.js +1 -1
- package/dist/sdk/models/shared/cancelsubscriptionparams.d.ts +19 -0
- package/dist/sdk/models/shared/cancelsubscriptionparams.js +63 -0
- package/dist/sdk/models/shared/changeoption.d.ts +0 -3
- package/dist/sdk/models/shared/changeoption.js +0 -3
- package/dist/sdk/models/shared/coupon.d.ts +14 -10
- package/dist/sdk/models/shared/coupon.js +16 -6
- package/dist/sdk/models/shared/couponredemption.d.ts +6 -0
- package/dist/sdk/models/shared/{usageitem.js → couponredemption.js} +12 -12
- package/dist/sdk/models/shared/coupons.d.ts +2 -5
- package/dist/sdk/models/shared/coupons.js +0 -3
- package/dist/sdk/models/shared/{newinvoicelineitem.d.ts → createinvoicelineitemparams.d.ts} +5 -5
- package/dist/sdk/models/shared/{newinvoicelineitem.js → createinvoicelineitemparams.js} +15 -13
- package/dist/sdk/models/shared/createoneoffinvoiceparams.d.ts +33 -0
- package/dist/sdk/models/shared/createoneoffinvoiceparams.js +86 -0
- package/dist/sdk/models/shared/creditblockexpiryledgerentry.d.ts +27 -0
- package/dist/sdk/models/shared/creditblockexpiryledgerentry.js +120 -0
- package/dist/sdk/models/shared/creditledgerentries.d.ts +1 -5
- package/dist/sdk/models/shared/creditledgerentries.js +1 -6
- package/dist/sdk/models/shared/creditnote.d.ts +34 -22
- package/dist/sdk/models/shared/creditnote.js +44 -7
- package/dist/sdk/models/shared/creditnotelineitem.d.ts +12 -10
- package/dist/sdk/models/shared/creditnotelineitem.js +24 -10
- package/dist/sdk/models/shared/creditnoteminified.d.ts +7 -0
- package/dist/sdk/models/shared/creditnoteminified.js +45 -0
- package/dist/sdk/models/shared/creditnotes.d.ts +2 -5
- package/dist/sdk/models/shared/creditnotes.js +0 -3
- package/dist/sdk/models/shared/{sublineitem2.d.ts → creditnotesublineitem.d.ts} +1 -1
- package/dist/sdk/models/shared/{sublineitem2.js → creditnotesublineitem.js} +9 -9
- package/dist/sdk/models/shared/creditnotesummary.d.ts +9 -6
- package/dist/sdk/models/shared/customer.d.ts +30 -181
- package/dist/sdk/models/shared/customer.js +41 -223
- package/dist/sdk/models/shared/customerbalancetransaction.d.ts +13 -28
- package/dist/sdk/models/shared/customerbalancetransaction.js +18 -42
- package/dist/sdk/models/shared/{transactions.d.ts → customerbalancetransactions.d.ts} +3 -6
- package/dist/sdk/models/shared/{transactions.js → customerbalancetransactions.js} +8 -11
- package/dist/sdk/models/shared/customercosts.d.ts +2 -5
- package/dist/sdk/models/shared/customercosts.js +3 -6
- package/dist/sdk/models/shared/customercreditbalance.d.ts +7 -0
- package/dist/sdk/models/shared/customercreditbalance.js +64 -0
- package/dist/sdk/models/shared/customercreditbalances.d.ts +7 -0
- package/dist/sdk/models/shared/customercreditbalances.js +54 -0
- package/dist/sdk/models/shared/customerminified.d.ts +0 -3
- package/dist/sdk/models/shared/customerminified.js +0 -3
- package/dist/sdk/models/shared/customers.d.ts +0 -3
- package/dist/sdk/models/shared/customers.js +0 -3
- package/dist/sdk/models/shared/customertaxid.d.ts +6 -0
- package/dist/sdk/models/shared/{newtransaction.js → customertaxid.js} +12 -13
- package/dist/sdk/models/shared/debug.d.ts +2 -2
- package/dist/sdk/models/shared/decrementledgerentry.d.ts +30 -0
- package/dist/sdk/models/shared/{creditledgerentry.js → decrementledgerentry.js} +42 -51
- package/dist/sdk/models/shared/deletecustomerresponse.d.ts +3 -0
- package/dist/sdk/models/shared/deletecustomerresponse.js +30 -0
- package/dist/sdk/models/shared/deprecatedeventresult.d.ts +1 -4
- package/dist/sdk/models/shared/deprecatedeventresult.js +0 -3
- package/dist/sdk/models/shared/discount.d.ts +13 -5
- package/dist/sdk/models/shared/discount.js +13 -4
- package/dist/sdk/models/shared/duplicateconstraintviolationerror.d.ts +16 -0
- package/dist/sdk/models/shared/duplicateconstraintviolationerror.js +82 -0
- package/dist/sdk/models/shared/duplicateresourcecreationerror.d.ts +16 -0
- package/dist/sdk/models/shared/duplicateresourcecreationerror.js +82 -0
- package/dist/sdk/models/shared/editcustomer.d.ts +72 -0
- package/dist/sdk/models/shared/editcustomer.js +151 -0
- package/dist/sdk/models/shared/editplan.d.ts +10 -0
- package/dist/sdk/models/shared/editplan.js +59 -0
- package/dist/sdk/models/shared/editpriceintervalparams.d.ts +34 -0
- package/dist/sdk/models/shared/editpriceintervalparams.js +78 -0
- package/dist/sdk/models/shared/event.d.ts +11 -4
- package/dist/sdk/models/shared/event.js +14 -3
- package/dist/sdk/models/shared/{credits.d.ts → events.d.ts} +3 -6
- package/dist/sdk/models/shared/{eventsearchresults.js → events.js} +8 -11
- package/dist/sdk/models/shared/expirationchangeledgerentry.d.ts +28 -0
- package/dist/sdk/models/shared/expirationchangeledgerentry.js +129 -0
- package/dist/sdk/models/shared/featurenotavailableerror.d.ts +16 -0
- package/dist/sdk/models/shared/featurenotavailableerror.js +82 -0
- package/dist/sdk/models/shared/fivehundrederror.d.ts +13 -0
- package/dist/sdk/models/shared/fivehundrederror.js +78 -0
- package/dist/sdk/models/shared/fivetranexampleprice.d.ts +241 -0
- package/dist/sdk/models/shared/fivetranexampleprice.js +361 -0
- package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +12 -5
- package/dist/sdk/models/shared/fixedfeequantitychange.js +12 -3
- package/dist/sdk/models/shared/fixedfeequantityscheduleentry.d.ts +7 -0
- package/dist/sdk/models/shared/{fixedfeequantityschedule.js → fixedfeequantityscheduleentry.js} +10 -10
- package/dist/sdk/models/shared/fixedfeequantitytransition.d.ts +6 -0
- package/dist/sdk/models/shared/fixedfeequantitytransition.js +59 -0
- package/dist/sdk/models/shared/fourhundredandoneerror.d.ts +16 -0
- package/dist/sdk/models/shared/fourhundredandoneerror.js +82 -0
- package/dist/sdk/models/shared/fourhundredandtwentynineerror.d.ts +16 -0
- package/dist/sdk/models/shared/fourhundredandtwentynineerror.js +82 -0
- package/dist/sdk/models/shared/groupedsubscriptionusage.d.ts +7 -0
- package/dist/sdk/models/shared/groupedsubscriptionusage.js +54 -0
- package/dist/sdk/models/shared/groupedsubscriptionusagerecord.d.ts +14 -0
- package/dist/sdk/models/shared/groupedsubscriptionusagerecord.js +71 -0
- package/dist/sdk/models/shared/idempotencyconflict.d.ts +16 -0
- package/dist/sdk/models/shared/idempotencyconflict.js +82 -0
- package/dist/sdk/models/shared/idempotencykeyvalidationerror.d.ts +17 -0
- package/dist/sdk/models/shared/idempotencykeyvalidationerror.js +87 -0
- package/dist/sdk/models/shared/idempotencyrequestmismatch.d.ts +16 -0
- package/dist/sdk/models/shared/idempotencyrequestmismatch.js +82 -0
- package/dist/sdk/models/shared/{invoicesettings.d.ts → incrementcreditledgerentryinvoicesettings.d.ts} +2 -2
- package/dist/sdk/models/shared/{invoicesettings.js → incrementcreditledgerentryinvoicesettings.js} +10 -10
- package/dist/sdk/models/shared/incrementledgerentry.d.ts +27 -0
- package/dist/sdk/models/shared/incrementledgerentry.js +120 -0
- package/dist/sdk/models/shared/index.d.ts +144 -54
- package/dist/sdk/models/shared/index.js +144 -54
- package/dist/sdk/models/shared/ingestevent.d.ts +32 -0
- package/dist/sdk/models/shared/ingestevent.js +86 -0
- package/dist/sdk/models/shared/ingestionresponse.d.ts +5 -5
- package/dist/sdk/models/shared/ingestionresponse.js +3 -6
- package/dist/sdk/models/shared/ingestrequestbody.d.ts +5 -0
- package/dist/sdk/models/shared/{tieredbpsconfig1.js → ingestrequestbody.js} +11 -11
- package/dist/sdk/models/shared/invoice.d.ts +46 -182
- package/dist/sdk/models/shared/invoice.js +70 -201
- package/dist/sdk/models/shared/invoicelineitem.d.ts +10 -168
- package/dist/sdk/models/shared/invoicelineitem.js +21 -303
- package/dist/sdk/models/shared/invoicelineitemparams.d.ts +27 -0
- package/dist/sdk/models/shared/invoicelineitemparams.js +92 -0
- package/dist/sdk/models/shared/invoiceminified.d.ts +7 -0
- package/dist/sdk/models/shared/invoiceminified.js +45 -0
- package/dist/sdk/models/shared/invoices.d.ts +2 -5
- package/dist/sdk/models/shared/invoices.js +0 -3
- package/dist/sdk/models/shared/item.d.ts +14 -0
- package/dist/sdk/models/shared/item.js +72 -0
- package/dist/sdk/models/shared/itemexternalconnection.d.ts +16 -0
- package/dist/sdk/models/shared/itemexternalconnection.js +63 -0
- package/dist/sdk/models/shared/items.d.ts +7 -0
- package/dist/sdk/models/shared/{credits.js → items.js} +11 -14
- package/dist/sdk/models/shared/itemslim.d.ts +5 -0
- package/dist/sdk/models/shared/itemslim.js +50 -0
- package/dist/sdk/models/shared/markaspaidrequestparams.d.ts +16 -0
- package/dist/sdk/models/shared/markaspaidrequestparams.js +61 -0
- package/dist/sdk/models/shared/matrixconfig.d.ts +12 -5
- package/dist/sdk/models/shared/matrixconfig.js +5 -3
- package/dist/sdk/models/shared/matrixprice.d.ts +242 -0
- package/dist/sdk/models/shared/matrixprice.js +363 -0
- package/dist/sdk/models/shared/matrixsublineitem.d.ts +17 -0
- package/dist/sdk/models/shared/matrixsublineitem.js +78 -0
- package/dist/sdk/models/shared/matrixvalue.d.ts +8 -1
- package/dist/sdk/models/shared/matrixvalue.js +5 -0
- package/dist/sdk/models/shared/maximum.d.ts +11 -0
- package/dist/sdk/models/shared/{subscriptionusage.js → maximum.js} +14 -14
- package/dist/sdk/models/shared/maximuminterval.d.ts +23 -0
- package/dist/sdk/models/shared/{subscriptioncost.js → maximuminterval.js} +21 -23
- package/dist/sdk/models/shared/metricgroup.d.ts +5 -0
- package/dist/sdk/models/shared/metricgroup.js +50 -0
- package/dist/sdk/models/shared/minimum.d.ts +11 -0
- package/dist/sdk/models/shared/minimum.js +50 -0
- package/dist/sdk/models/shared/minimuminterval.d.ts +23 -0
- package/dist/sdk/models/shared/minimuminterval.js +73 -0
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.d.ts +6 -0
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.js +52 -0
- package/dist/sdk/models/shared/newbackfill.d.ts +1 -1
- package/dist/sdk/models/shared/newbillablemetric.d.ts +28 -0
- package/dist/sdk/models/shared/newbillablemetric.js +77 -0
- package/dist/sdk/models/shared/newbpsprice.d.ts +53 -0
- package/dist/sdk/models/shared/newbpsprice.js +110 -0
- package/dist/sdk/models/shared/newbulkbpsprice.d.ts +53 -0
- package/dist/sdk/models/shared/newbulkbpsprice.js +110 -0
- package/dist/sdk/models/shared/newbulkprice.d.ts +53 -0
- package/dist/sdk/models/shared/newbulkprice.js +110 -0
- package/dist/sdk/models/shared/newcoupon.d.ts +4 -10
- package/dist/sdk/models/shared/newcoupon.js +11 -11
- package/dist/sdk/models/shared/newcustomer.d.ts +20 -154
- package/dist/sdk/models/shared/newcustomer.js +34 -206
- package/dist/sdk/models/shared/newcustomerbalancetransaction.d.ts +13 -0
- package/dist/sdk/models/shared/newcustomerbalancetransaction.js +60 -0
- package/dist/sdk/models/shared/newmatrixprice.d.ts +53 -0
- package/dist/sdk/models/shared/{sublineitem.js → newmatrixprice.js} +51 -43
- package/dist/sdk/models/shared/newpackageprice.d.ts +53 -0
- package/dist/sdk/models/shared/newpackageprice.js +110 -0
- package/dist/sdk/models/shared/newpackagewithallocationprice.d.ts +52 -0
- package/dist/sdk/models/shared/newpackagewithallocationprice.js +108 -0
- package/dist/sdk/models/shared/newplan.d.ts +26 -0
- package/dist/sdk/models/shared/newplan.js +93 -0
- package/dist/sdk/models/shared/newreportingconfiguration.d.ts +4 -0
- package/dist/sdk/models/shared/newreportingconfiguration.js +45 -0
- package/dist/sdk/models/shared/newsubscription.d.ts +18 -43
- package/dist/sdk/models/shared/newsubscription.js +50 -8
- package/dist/sdk/models/shared/newthresholdtotalamountprice.d.ts +52 -0
- package/dist/sdk/models/shared/newthresholdtotalamountprice.js +108 -0
- package/dist/sdk/models/shared/newtieredbpsprice.d.ts +53 -0
- package/dist/sdk/models/shared/newtieredbpsprice.js +110 -0
- package/dist/sdk/models/shared/newtieredpackageprice.d.ts +52 -0
- package/dist/sdk/models/shared/newtieredpackageprice.js +108 -0
- package/dist/sdk/models/shared/newtieredprice.d.ts +53 -0
- package/dist/sdk/models/shared/newtieredprice.js +110 -0
- package/dist/sdk/models/shared/newtieredwithminimumprice.d.ts +52 -0
- package/dist/sdk/models/shared/newtieredwithminimumprice.js +108 -0
- package/dist/sdk/models/shared/newunitprice.d.ts +53 -0
- package/dist/sdk/models/shared/newunitprice.js +110 -0
- package/dist/sdk/models/shared/othersublineitem.d.ts +15 -0
- package/dist/sdk/models/shared/othersublineitem.js +71 -0
- package/dist/sdk/models/shared/overridebpsprice.d.ts +27 -0
- package/dist/sdk/models/shared/{bpspriceoverride.js → overridebpsprice.js} +27 -18
- package/dist/sdk/models/shared/overridebulkbpsprice.d.ts +27 -0
- package/dist/sdk/models/shared/{bulkbpspriceoverride.js → overridebulkbpsprice.js} +27 -18
- package/dist/sdk/models/shared/overridebulkprice.d.ts +27 -0
- package/dist/sdk/models/shared/{bulkpriceoverride.js → overridebulkprice.js} +27 -18
- package/dist/sdk/models/shared/overridefivetranexampleprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridefivetranexampleprice.js +81 -0
- package/dist/sdk/models/shared/overridematrixprice.d.ts +27 -0
- package/dist/sdk/models/shared/overridematrixprice.js +83 -0
- package/dist/sdk/models/shared/overridepackageprice.d.ts +27 -0
- package/dist/sdk/models/shared/{packagepriceoverride.js → overridepackageprice.js} +27 -18
- package/dist/sdk/models/shared/overridepackagewithallocationprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridepackagewithallocationprice.js +81 -0
- package/dist/sdk/models/shared/overridetestratingfunctionprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridetestratingfunctionprice.js +81 -0
- package/dist/sdk/models/shared/overridethresholdtotalamountprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridethresholdtotalamountprice.js +81 -0
- package/dist/sdk/models/shared/overridetieredbpsprice.d.ts +27 -0
- package/dist/sdk/models/shared/{tieredbpspriceoverride.js → overridetieredbpsprice.js} +30 -21
- package/dist/sdk/models/shared/overridetieredpackageprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridetieredpackageprice.js +81 -0
- package/dist/sdk/models/shared/overridetieredprice.d.ts +27 -0
- package/dist/sdk/models/shared/{tieredpriceoverride.js → overridetieredprice.js} +27 -18
- package/dist/sdk/models/shared/overridetieredwithminimumprice.d.ts +26 -0
- package/dist/sdk/models/shared/overridetieredwithminimumprice.js +81 -0
- package/dist/sdk/models/shared/overrideunitprice.d.ts +27 -0
- package/dist/sdk/models/shared/{unitpriceoverride.js → overrideunitprice.js} +27 -18
- package/dist/sdk/models/shared/packageconfig.d.ts +7 -4
- package/dist/sdk/models/shared/packageconfig.js +0 -3
- package/dist/sdk/models/shared/packageprice.d.ts +242 -0
- package/dist/sdk/models/shared/packageprice.js +363 -0
- package/dist/sdk/models/shared/packagewithallocationprice.d.ts +241 -0
- package/dist/sdk/models/shared/packagewithallocationprice.js +361 -0
- package/dist/sdk/models/shared/percentagediscount.d.ts +15 -0
- package/dist/sdk/models/shared/percentagediscount.js +59 -0
- package/dist/sdk/models/shared/percentagediscountcreationparams.d.ts +11 -0
- package/dist/sdk/models/shared/percentagediscountcreationparams.js +54 -0
- package/dist/sdk/models/shared/percentagediscountinterval.d.ts +27 -0
- package/dist/sdk/models/shared/percentagediscountinterval.js +82 -0
- package/dist/sdk/models/shared/perpricecost.d.ts +206 -6
- package/dist/sdk/models/shared/perpricecost.js +6 -6
- package/dist/sdk/models/shared/phaseoverride.d.ts +7 -30
- package/dist/sdk/models/shared/phaseoverride.js +4 -42
- package/dist/sdk/models/shared/{availability.d.ts → pingresponse.d.ts} +1 -4
- package/dist/sdk/models/shared/{availability.js → pingresponse.js} +7 -10
- package/dist/sdk/models/shared/plan.d.ts +29 -62
- package/dist/sdk/models/shared/plan.js +55 -108
- package/dist/sdk/models/shared/planminified.d.ts +6 -2
- package/dist/sdk/models/shared/planminified.js +5 -0
- package/dist/sdk/models/shared/planphase.d.ts +18 -58
- package/dist/sdk/models/shared/planphase.js +30 -86
- package/dist/sdk/models/shared/plans.d.ts +2 -5
- package/dist/sdk/models/shared/plans.js +0 -3
- package/dist/sdk/models/shared/pricegroup.d.ts +2 -2
- package/dist/sdk/models/shared/priceinterval.d.ts +239 -0
- package/dist/sdk/models/shared/priceinterval.js +104 -0
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.d.ts +11 -0
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.js +54 -0
- package/dist/sdk/models/shared/prices.d.ts +6 -0
- package/dist/sdk/models/shared/prices.js +52 -0
- package/dist/sdk/models/shared/reportingconfiguration.d.ts +4 -0
- package/dist/sdk/models/shared/reportingconfiguration.js +45 -0
- package/dist/sdk/models/shared/requesttoolargeerror.d.ts +16 -0
- package/dist/sdk/models/shared/requesttoolargeerror.js +82 -0
- package/dist/sdk/models/shared/requestvalidationerror.d.ts +14 -17
- package/dist/sdk/models/shared/requestvalidationerror.js +29 -7
- package/dist/sdk/models/shared/resourcenotfounderror.d.ts +16 -0
- package/dist/sdk/models/shared/resourcenotfounderror.js +82 -0
- package/dist/sdk/models/shared/resourcetoolargeerror.d.ts +16 -0
- package/dist/sdk/models/shared/resourcetoolargeerror.js +82 -0
- package/dist/sdk/models/shared/sublineitemgrouping.d.ts +8 -0
- package/dist/sdk/models/shared/{grouping.js → sublineitemgrouping.js} +8 -11
- package/dist/sdk/models/shared/sublineitemmatrixconfig.d.ts +7 -0
- package/dist/sdk/models/shared/{matrixconfig1.js → sublineitemmatrixconfig.js} +7 -10
- package/dist/sdk/models/shared/subscription.d.ts +64 -31
- package/dist/sdk/models/shared/subscription.js +61 -42
- package/dist/sdk/models/shared/subscriptioncosts.d.ts +2 -5
- package/dist/sdk/models/shared/subscriptioncosts.js +3 -6
- package/dist/sdk/models/shared/subscriptionminified.d.ts +0 -3
- package/dist/sdk/models/shared/subscriptionminified.js +0 -3
- package/dist/sdk/models/shared/subscriptionplanchange.d.ts +20 -15
- package/dist/sdk/models/shared/subscriptionplanchange.js +37 -15
- package/dist/sdk/models/shared/subscriptions.d.ts +2 -5
- package/dist/sdk/models/shared/subscriptions.js +0 -3
- package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +3 -3
- package/dist/sdk/models/shared/{subscriptionschedule.d.ts → subscriptionscheduleitems.d.ts} +3 -6
- package/dist/sdk/models/shared/{subscriptionschedule.js → subscriptionscheduleitems.js} +8 -11
- package/dist/sdk/models/shared/subscriptiontrialinfo.d.ts +4 -0
- package/dist/sdk/models/shared/{subscriptioncancellation.js → subscriptiontrialinfo.js} +8 -14
- package/dist/sdk/models/shared/testratingfunctionprice.d.ts +241 -0
- package/dist/sdk/models/shared/testratingfunctionprice.js +361 -0
- package/dist/sdk/models/shared/thresholdtotalamountprice.d.ts +241 -0
- package/dist/sdk/models/shared/thresholdtotalamountprice.js +361 -0
- package/dist/sdk/models/shared/tier.d.ts +11 -2
- package/dist/sdk/models/shared/tier.js +2 -2
- package/dist/sdk/models/shared/tierconfig.d.ts +2 -5
- package/dist/sdk/models/shared/tierconfig.js +2 -5
- package/dist/sdk/models/shared/tieredbpsconfig.d.ts +4 -4
- package/dist/sdk/models/shared/tieredbpsconfig.js +0 -3
- package/dist/sdk/models/shared/tieredbpsprice.d.ts +242 -0
- package/dist/sdk/models/shared/tieredbpsprice.js +363 -0
- package/dist/sdk/models/shared/tieredconfig.d.ts +4 -4
- package/dist/sdk/models/shared/tieredconfig.js +0 -3
- package/dist/sdk/models/shared/tieredpackageprice.d.ts +241 -0
- package/dist/sdk/models/shared/tieredpackageprice.js +361 -0
- package/dist/sdk/models/shared/tieredprice.d.ts +242 -0
- package/dist/sdk/models/shared/tieredprice.js +363 -0
- package/dist/sdk/models/shared/tieredwithminimumprice.d.ts +241 -0
- package/dist/sdk/models/shared/tieredwithminimumprice.js +361 -0
- package/dist/sdk/models/shared/tiersublineitem.d.ts +17 -0
- package/dist/sdk/models/shared/{sublineitem1.js → tiersublineitem.js} +21 -18
- package/dist/sdk/models/shared/trialconfig.d.ts +1 -1
- package/dist/sdk/models/shared/trialdiscount.d.ts +19 -0
- package/dist/sdk/models/shared/trialdiscount.js +64 -0
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.d.ts +8 -0
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.js +51 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusage.d.ts +5 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusage.js +47 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusagerecord.d.ts +12 -0
- package/dist/sdk/models/shared/ungroupedsubscriptionusagerecord.js +64 -0
- package/dist/sdk/models/shared/unitconfig.d.ts +8 -4
- package/dist/sdk/models/shared/unitconfig.js +5 -3
- package/dist/sdk/models/shared/unitprice.d.ts +242 -0
- package/dist/sdk/models/shared/unitprice.js +363 -0
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.d.ts +7 -0
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.js +45 -0
- package/dist/sdk/models/shared/upcominginvoice.d.ts +89 -54
- package/dist/sdk/models/shared/upcominginvoice.js +216 -88
- package/dist/sdk/models/shared/updateevent.d.ts +1 -1
- package/dist/sdk/models/shared/updateevent.js +5 -1
- package/dist/sdk/models/shared/urlnotfound.d.ts +16 -0
- package/dist/sdk/models/shared/urlnotfound.js +82 -0
- package/dist/sdk/models/shared/usage.d.ts +3 -10
- package/dist/sdk/models/shared/usage.js +18 -24
- package/dist/sdk/models/shared/usagediscount.d.ts +15 -0
- package/dist/sdk/models/shared/{tier7.js → usagediscount.js} +18 -19
- package/dist/sdk/models/shared/usagediscountcreationparams.d.ts +11 -0
- package/dist/sdk/models/shared/usagediscountcreationparams.js +54 -0
- package/dist/sdk/models/shared/usagediscountinterval.d.ts +27 -0
- package/dist/sdk/models/shared/usagediscountinterval.js +82 -0
- package/dist/sdk/models/shared/validationerror.d.ts +11 -0
- package/dist/sdk/models/shared/validationerror.js +50 -0
- package/dist/sdk/models/shared/voidinitiatedledgerentry.d.ts +30 -0
- package/dist/sdk/models/shared/voidinitiatedledgerentry.js +139 -0
- package/dist/sdk/models/shared/voidledgerentry.d.ts +29 -0
- package/dist/sdk/models/shared/voidledgerentry.js +130 -0
- package/dist/sdk/plan.d.ts +54 -186
- package/dist/sdk/plan.js +656 -202
- package/dist/sdk/price.d.ts +246 -0
- package/dist/sdk/price.js +790 -0
- package/dist/sdk/priceinterval.d.ts +65 -0
- package/dist/sdk/priceinterval.js +281 -0
- package/dist/sdk/sdk.d.ts +149 -58
- package/dist/sdk/sdk.js +23 -40
- package/dist/sdk/subscription.d.ts +435 -280
- package/dist/sdk/subscription.js +1516 -350
- package/docs/models/operations/addeditpriceintervalsrequest.md +9 -0
- package/docs/models/operations/addeditpriceintervalsresponse.md +18 -0
- package/docs/models/operations/amendeventrequest.md +9 -0
- package/docs/models/operations/amendeventresponse.md +18 -0
- package/docs/models/operations/amendusageexternalcustomeridrequest.md +11 -0
- package/docs/models/operations/amendusageexternalcustomeridresponse.md +18 -0
- package/docs/models/operations/amendusagerequest.md +11 -0
- package/docs/models/operations/amendusageresponse.md +18 -0
- package/docs/models/operations/archivecouponrequest.md +8 -0
- package/docs/models/operations/archivecouponresponse.md +18 -0
- package/docs/models/operations/cancelsubscriptionrequest.md +9 -0
- package/docs/models/operations/cancelsubscriptionresponse.md +18 -0
- package/docs/models/operations/closebackfillrequest.md +8 -0
- package/docs/models/operations/closebackfillresponse.md +18 -0
- package/docs/models/operations/createbackfillresponse.md +18 -0
- package/docs/models/operations/createcouponresponse.md +18 -0
- package/docs/models/operations/createcustomerbalancetransactionrequest.md +9 -0
- package/docs/models/operations/createcustomerbalancetransactionresponse.md +18 -0
- package/docs/models/operations/createcustomerresponse.md +18 -0
- package/docs/models/operations/createinvoicelineitemresponse.md +18 -0
- package/docs/models/operations/createinvoiceresponse.md +18 -0
- package/docs/models/operations/createledgerentryexternalidrequest.md +9 -0
- package/docs/models/operations/createledgerentryexternalidresponse.md +18 -0
- package/docs/models/operations/createledgerentryrequest.md +9 -0
- package/docs/models/operations/createledgerentryresponse.md +18 -0
- package/docs/models/operations/createmetricresponse.md +18 -0
- package/docs/models/operations/createplanresponse.md +18 -0
- package/docs/models/operations/createpriceresponse.md +18 -0
- package/docs/models/operations/createsubscriptionresponse.md +18 -0
- package/docs/models/operations/deletecustomerrequest.md +8 -0
- package/docs/models/operations/deletecustomerresponse.md +18 -0
- package/docs/models/operations/deprecateeventrequest.md +8 -0
- package/docs/models/operations/deprecateeventresponse.md +18 -0
- package/docs/models/operations/fetchbackfillrequest.md +8 -0
- package/docs/models/operations/fetchbackfillresponse.md +18 -0
- package/docs/models/operations/fetchcouponrequest.md +8 -0
- package/docs/models/operations/fetchcouponresponse.md +18 -0
- package/docs/models/operations/fetchcreditnoterequest.md +8 -0
- package/docs/models/operations/fetchcreditnoteresponse.md +18 -0
- package/docs/models/operations/fetchcustomercostsexternalidrequest.md +12 -0
- package/docs/models/operations/fetchcustomercostsexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomercostsexternalidviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchcustomercostsrequest.md +12 -0
- package/docs/models/operations/fetchcustomercostsresponse.md +18 -0
- package/docs/models/operations/fetchcustomercostsviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchcustomercreditsexternalidrequest.md +10 -0
- package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerentrystatusentrystatus.md +9 -0
- package/docs/models/operations/fetchcustomercreditsledgerentrytypeentrytype.md +14 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrystatusentrystatus.md +9 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrytypeentrytype.md +14 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidrequest.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerrequest.md +18 -0
- package/docs/models/operations/fetchcustomercreditsledgerresponse.md +18 -0
- package/docs/models/operations/fetchcustomercreditsrequest.md +10 -0
- package/docs/models/operations/fetchcustomercreditsresponse.md +18 -0
- package/docs/models/operations/fetchcustomerexternalidrequest.md +8 -0
- package/docs/models/operations/fetchcustomerexternalidresponse.md +18 -0
- package/docs/models/operations/fetchcustomerrequest.md +8 -0
- package/docs/models/operations/fetchcustomerresponse.md +18 -0
- package/docs/models/operations/fetchinvoicerequest.md +8 -0
- package/docs/models/operations/fetchinvoiceresponse.md +18 -0
- package/docs/models/operations/fetchitemrequest.md +8 -0
- package/docs/models/operations/fetchitemresponse.md +18 -0
- package/docs/models/operations/fetchmetricrequest.md +8 -0
- package/docs/models/operations/fetchmetricresponse.md +18 -0
- package/docs/models/operations/fetchplanexternalidrequest.md +8 -0
- package/docs/models/operations/fetchplanexternalidresponse.md +18 -0
- package/docs/models/operations/fetchplanrequest.md +8 -0
- package/docs/models/operations/fetchplanresponse.md +18 -0
- package/docs/models/operations/fetchpriceexternalidrequest.md +8 -0
- package/docs/models/operations/fetchpriceexternalidresponse.md +18 -0
- package/docs/models/operations/fetchpricerequest.md +8 -0
- package/docs/models/operations/fetchpriceresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptioncostsrequest.md +12 -0
- package/docs/models/operations/fetchsubscriptioncostsresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptioncostsviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchsubscriptionrequest.md +8 -0
- package/docs/models/operations/fetchsubscriptionresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptionschedulerequest.md +14 -0
- package/docs/models/operations/fetchsubscriptionscheduleresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptionusagegranularitygranularity.md +10 -0
- package/docs/models/operations/fetchsubscriptionusagerequest.md +20 -0
- package/docs/models/operations/fetchsubscriptionusageresponse.md +18 -0
- package/docs/models/operations/fetchsubscriptionusageviewmodeviewmode.md +11 -0
- package/docs/models/operations/fetchupcominginvoicerequest.md +8 -0
- package/docs/models/operations/fetchupcominginvoiceresponse.md +18 -0
- package/docs/models/operations/ingestrequest.md +10 -0
- package/docs/models/operations/ingestresponse.md +18 -0
- package/docs/models/operations/issueinvoicerequest.md +8 -0
- package/docs/models/operations/issueinvoiceresponse.md +18 -0
- package/docs/models/operations/listbackfillsrequest.md +9 -0
- package/docs/models/operations/listbackfillsresponse.md +18 -0
- package/docs/models/operations/listbalancetransactionsrequest.md +14 -0
- package/docs/models/operations/listbalancetransactionsresponse.md +18 -0
- package/docs/models/operations/listcouponsrequest.md +11 -0
- package/docs/models/operations/listcouponsresponse.md +18 -0
- package/docs/models/operations/listcouponsubscriptionsrequest.md +10 -0
- package/docs/models/operations/listcouponsubscriptionsresponse.md +18 -0
- package/docs/models/operations/listcreditnotesrequest.md +9 -0
- package/docs/models/operations/listcreditnotesresponse.md +18 -0
- package/docs/models/operations/listcustomersrequest.md +13 -0
- package/docs/models/operations/listcustomersresponse.md +18 -0
- package/docs/models/operations/listinvoicesdatetypedatetype.md +9 -0
- package/docs/models/operations/listinvoicesrequest.md +27 -0
- package/docs/models/operations/listinvoicesresponse.md +18 -0
- package/docs/models/operations/listinvoicesstatus.md +12 -0
- package/docs/models/operations/listinvoicesstatusstatus.md +12 -0
- package/docs/models/operations/listitemsrequest.md +9 -0
- package/docs/models/operations/listitemsresponse.md +18 -0
- package/docs/models/operations/listmetricsrequest.md +13 -0
- package/docs/models/operations/listmetricsresponse.md +18 -0
- package/docs/models/operations/listplansrequest.md +14 -0
- package/docs/models/operations/listplansresponse.md +18 -0
- package/docs/models/operations/listplansstatusstatus.md +12 -0
- package/docs/models/operations/listpricesrequest.md +9 -0
- package/docs/models/operations/listpricesresponse.md +18 -0
- package/docs/models/operations/listsubscriptionsrequest.md +16 -0
- package/docs/models/operations/listsubscriptionsresponse.md +18 -0
- package/docs/models/operations/listsubscriptionsstatusstatus.md +10 -0
- package/docs/models/operations/markinvoiceaspaidrequest.md +9 -0
- package/docs/models/operations/markinvoiceaspaidresponse.md +18 -0
- package/docs/models/operations/pingresponse.md +18 -0
- package/docs/models/operations/revertbackfillrequest.md +8 -0
- package/docs/models/operations/revertbackfillresponse.md +18 -0
- package/docs/models/operations/scheduleplanchangerequest.md +9 -0
- package/docs/models/operations/scheduleplanchangeresponse.md +18 -0
- package/docs/models/operations/searcheventsrequest.md +14 -0
- package/docs/models/operations/searcheventsresponse.md +18 -0
- package/docs/models/operations/triggerphaserequest.md +9 -0
- package/docs/models/operations/triggerphaseresponse.md +18 -0
- package/docs/models/operations/unschedulecancellationrequest.md +8 -0
- package/docs/models/operations/unschedulecancellationresponse.md +18 -0
- package/docs/models/operations/unschedulefixedfeequantityrequest.md +9 -0
- package/docs/models/operations/unschedulefixedfeequantityresponse.md +18 -0
- package/docs/models/operations/unscheduleplanchangerequest.md +8 -0
- package/docs/models/operations/unscheduleplanchangeresponse.md +18 -0
- package/docs/models/operations/updatecustomerexternalidrequest.md +9 -0
- package/docs/models/operations/updatecustomerexternalidresponse.md +18 -0
- package/docs/models/operations/updatecustomerrequest.md +9 -0
- package/docs/models/operations/updatecustomerresponse.md +18 -0
- package/docs/models/operations/updatefixedfeequantityrequest.md +9 -0
- package/docs/models/operations/updatefixedfeequantityresponse.md +18 -0
- package/docs/models/operations/updateplanexternalrequest.md +9 -0
- package/docs/models/operations/updateplanexternalresponse.md +18 -0
- package/docs/models/operations/updateplanrequest.md +9 -0
- package/docs/models/operations/updateplanresponse.md +18 -0
- package/docs/models/operations/voidinvoicerequest.md +8 -0
- package/docs/models/operations/voidinvoiceresponse.md +18 -0
- package/docs/models/shared/accountingprovider.md +9 -0
- package/docs/models/shared/accountingproviderconfig.md +9 -0
- package/docs/models/shared/accountingproviderprovidertype.md +9 -0
- package/docs/models/shared/accountingsyncconfiguration.md +9 -0
- package/docs/models/shared/addamendmentcreditledgerentryrequestparams.md +12 -0
- package/docs/models/shared/addamendmentcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addamendmentcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/adddecrementcreditledgerentryrequestparams.md +11 -0
- package/docs/models/shared/adddecrementcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/adddecrementcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addeditpriceintervalparams.md +9 -0
- package/docs/models/shared/addexpirationchangecreditledgerentryrequestparams.md +14 -0
- package/docs/models/shared/addexpirationchangecreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addexpirationchangecreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addincrementcreditledgerentryrequestparams.md +15 -0
- package/docs/models/shared/addincrementcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addincrementcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addpriceintervalparams.md +16 -0
- package/docs/models/shared/addpriceintervalparamsenddateenddate.md +11 -0
- package/docs/models/shared/addpriceintervalparamsstartdatestartdate.md +11 -0
- package/docs/models/shared/address.md +13 -0
- package/docs/models/shared/addressinput.md +13 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparams.md +13 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparamsentrytype.md +8 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparamsmetadata.md +9 -0
- package/docs/models/shared/addvoidcreditledgerentryrequestparamsvoidreason.md +10 -0
- package/docs/models/shared/affectedblock.md +10 -0
- package/docs/models/shared/aggregatedcost.md +12 -0
- package/docs/models/shared/amendedevent.md +12 -0
- package/docs/models/shared/amendedeventproperties.md +9 -0
- package/docs/models/shared/amendedusage.md +9 -0
- package/docs/models/shared/amendeventresult.md +8 -0
- package/docs/models/shared/amendmentledgerentry.md +21 -0
- package/docs/models/shared/amendmentledgerentryentrystatus.md +9 -0
- package/docs/models/shared/amendmentledgerentryentrytype.md +8 -0
- package/docs/models/shared/amountdiscount.md +10 -0
- package/docs/models/shared/amountdiscountcreationparams.md +9 -0
- package/docs/models/shared/amountdiscountcreationparamsdiscounttype.md +8 -0
- package/docs/models/shared/amountdiscountdiscounttype.md +8 -0
- package/docs/models/shared/amountdiscountinterval.md +13 -0
- package/docs/models/shared/amountdiscountintervaldiscounttype.md +8 -0
- package/docs/models/shared/autocollection.md +10 -0
- package/docs/models/shared/backfill.md +17 -0
- package/docs/models/shared/backfills.md +9 -0
- package/docs/models/shared/backfillstatus.md +13 -0
- package/docs/models/shared/billablemetric.md +16 -0
- package/docs/models/shared/billablemetrics.md +9 -0
- package/docs/models/shared/billablemetricsimple.md +9 -0
- package/docs/models/shared/billablemetricstatus.md +10 -0
- package/docs/models/shared/billablemetrictiny.md +8 -0
- package/docs/models/shared/billingcyclealignment.md +12 -0
- package/docs/models/shared/bpsconfig.md +9 -0
- package/docs/models/shared/bpsprice.md +225 -0
- package/docs/models/shared/bpspricecadence.md +11 -0
- package/docs/models/shared/bpspricemodeltype.md +8 -0
- package/docs/models/shared/bpspricepricetype.md +9 -0
- package/docs/models/shared/bpstier.md +11 -0
- package/docs/models/shared/bulkbpsconfig.md +8 -0
- package/docs/models/shared/bulkbpsprice.md +225 -0
- package/docs/models/shared/bulkbpspricecadence.md +11 -0
- package/docs/models/shared/bulkbpspricemodeltype.md +8 -0
- package/docs/models/shared/bulkbpspricepricetype.md +9 -0
- package/docs/models/shared/bulkbpstier.md +10 -0
- package/docs/models/shared/bulkconfig.md +8 -0
- package/docs/models/shared/bulkprice.md +225 -0
- package/docs/models/shared/bulkpricecadence.md +11 -0
- package/docs/models/shared/bulkpricemodeltype.md +8 -0
- package/docs/models/shared/bulkpricepricetype.md +9 -0
- package/docs/models/shared/bulktier.md +9 -0
- package/docs/models/shared/cancelsubscriptionparams.md +9 -0
- package/docs/models/shared/cancelsubscriptionparamscanceloption.md +12 -0
- package/docs/models/shared/changeoption.md +10 -0
- package/docs/models/shared/coupon.md +21 -0
- package/docs/models/shared/coupondiscount.md +7 -0
- package/docs/models/shared/couponredemption.md +10 -0
- package/docs/models/shared/coupons.md +9 -0
- package/docs/models/shared/createinvoicelineitemparams.md +13 -0
- package/docs/models/shared/createoneoffinvoiceparams.md +15 -0
- package/docs/models/shared/creditblockexpiryledgerentry.md +21 -0
- package/docs/models/shared/creditblockexpiryledgerentryentrystatus.md +9 -0
- package/docs/models/shared/creditblockexpiryledgerentryentrytype.md +8 -0
- package/docs/models/shared/creditledgerentries.md +9 -0
- package/docs/models/shared/creditnote.md +26 -0
- package/docs/models/shared/creditnotediscounts.md +7 -0
- package/docs/models/shared/creditnotelineitem.md +15 -0
- package/docs/models/shared/creditnotelineitemdiscounts.md +7 -0
- package/docs/models/shared/creditnotelineitemtaxamounts.md +7 -0
- package/docs/models/shared/creditnotemaximumamountadjustment.md +9 -0
- package/docs/models/shared/creditnoteminified.md +8 -0
- package/docs/models/shared/creditnotereason.md +11 -0
- package/docs/models/shared/creditnotes.md +9 -0
- package/docs/models/shared/creditnotesublineitem.md +10 -0
- package/docs/models/shared/creditnotesummary.md +13 -0
- package/docs/models/shared/creditnotetype.md +9 -0
- package/docs/models/shared/customer.md +42 -0
- package/docs/models/shared/customerbalancetransaction.md +17 -0
- package/docs/models/shared/customerbalancetransactionaction.md +10 -0
- package/docs/models/shared/customerbalancetransactions.md +9 -0
- package/docs/models/shared/customerbalancetransactiontype.md +9 -0
- package/docs/models/shared/customercosts.md +8 -0
- package/docs/models/shared/customercreditbalance.md +11 -0
- package/docs/models/shared/customercreditbalances.md +9 -0
- package/docs/models/shared/customerminified.md +9 -0
- package/docs/models/shared/customerpaymentprovider.md +14 -0
- package/docs/models/shared/customers.md +9 -0
- package/docs/models/shared/customertaxid.md +10 -0
- package/docs/models/shared/debug.md +11 -0
- package/docs/models/shared/decrementledgerentry.md +24 -0
- package/docs/models/shared/decrementledgerentryentrystatus.md +9 -0
- package/docs/models/shared/decrementledgerentryentrytype.md +8 -0
- package/docs/models/shared/deletecustomerresponse.md +7 -0
- package/docs/models/shared/deprecatedeventresult.md +8 -0
- package/docs/models/shared/discount.md +15 -0
- package/docs/models/shared/discountdiscounttype.md +11 -0
- package/docs/models/shared/duplicateconstraintviolationerror.md +12 -0
- package/docs/models/shared/duplicateconstraintviolationerrorheaders.md +7 -0
- package/docs/models/shared/duplicateconstraintviolationerrorstatus.md +8 -0
- package/docs/models/shared/duplicateconstraintviolationerrortype.md +8 -0
- package/docs/models/shared/duplicateresourcecreationerror.md +12 -0
- package/docs/models/shared/duplicateresourcecreationerrorheaders.md +7 -0
- package/docs/models/shared/duplicateresourcecreationerrorstatus.md +8 -0
- package/docs/models/shared/duplicateresourcecreationerrortype.md +8 -0
- package/docs/models/shared/editcustomer.md +22 -0
- package/docs/models/shared/editcustomermetadata.md +9 -0
- package/docs/models/shared/editcustomerpaymentprovider.md +16 -0
- package/docs/models/shared/editplan.md +9 -0
- package/docs/models/shared/editplanmetadata.md +7 -0
- package/docs/models/shared/editpriceintervalparams.md +11 -0
- package/docs/models/shared/editpriceintervalparamsenddateenddate.md +11 -0
- package/docs/models/shared/editpriceintervalparamsstartdatestartdate.md +11 -0
- package/docs/models/shared/event.md +17 -0
- package/docs/models/shared/eventproperties.md +9 -0
- package/docs/models/shared/events.md +9 -0
- package/docs/models/shared/eventsearchcriteria.md +9 -0
- package/docs/models/shared/expirationchangeledgerentry.md +22 -0
- package/docs/models/shared/expirationchangeledgerentryentrystatus.md +9 -0
- package/docs/models/shared/expirationchangeledgerentryentrytype.md +8 -0
- package/docs/models/shared/featurenotavailableerror.md +12 -0
- package/docs/models/shared/featurenotavailableerrorheaders.md +7 -0
- package/docs/models/shared/featurenotavailableerrorstatus.md +8 -0
- package/docs/models/shared/featurenotavailableerrortype.md +8 -0
- package/docs/models/shared/fivehundrederror.md +12 -0
- package/docs/models/shared/fivehundrederrorheaders.md +7 -0
- package/docs/models/shared/fivehundrederrortype.md +8 -0
- package/docs/models/shared/fivetranexampleprice.md +225 -0
- package/docs/models/shared/fivetranexamplepricecadence.md +11 -0
- package/docs/models/shared/fivetranexamplepricemodeltype.md +8 -0
- package/docs/models/shared/fivetranexamplepricepricetype.md +9 -0
- package/docs/models/shared/fixedfeequantitychange.md +11 -0
- package/docs/models/shared/fixedfeequantitychangechangeoption.md +12 -0
- package/docs/models/shared/fixedfeequantityscheduleentry.md +11 -0
- package/docs/models/shared/fixedfeequantitytransition.md +10 -0
- package/docs/models/shared/fourhundredandoneerror.md +12 -0
- package/docs/models/shared/fourhundredandoneerrorheaders.md +7 -0
- package/docs/models/shared/fourhundredandoneerrorstatus.md +8 -0
- package/docs/models/shared/fourhundredandoneerrortype.md +8 -0
- package/docs/models/shared/fourhundredandtwentynineerror.md +12 -0
- package/docs/models/shared/fourhundredandtwentynineerrorheaders.md +7 -0
- package/docs/models/shared/fourhundredandtwentynineerrorstatus.md +8 -0
- package/docs/models/shared/fourhundredandtwentynineerrortype.md +8 -0
- package/docs/models/shared/groupedsubscriptionusage.md +9 -0
- package/docs/models/shared/groupedsubscriptionusagerecord.md +11 -0
- package/docs/models/shared/groupedsubscriptionusagerecordviewmode.md +9 -0
- package/docs/models/shared/idempotencyconflict.md +12 -0
- package/docs/models/shared/idempotencyconflictheaders.md +7 -0
- package/docs/models/shared/idempotencyconflictstatus.md +8 -0
- package/docs/models/shared/idempotencyconflicttype.md +8 -0
- package/docs/models/shared/idempotencykeyvalidationerror.md +13 -0
- package/docs/models/shared/idempotencykeyvalidationerrorheaders.md +7 -0
- package/docs/models/shared/idempotencykeyvalidationerrorstatus.md +8 -0
- package/docs/models/shared/idempotencykeyvalidationerrortype.md +8 -0
- package/docs/models/shared/idempotencyrequestmismatch.md +12 -0
- package/docs/models/shared/idempotencyrequestmismatchheaders.md +7 -0
- package/docs/models/shared/idempotencyrequestmismatchstatus.md +8 -0
- package/docs/models/shared/idempotencyrequestmismatchtype.md +8 -0
- package/docs/models/shared/incrementcreditledgerentryinvoicesettings.md +12 -0
- package/docs/models/shared/incrementledgerentry.md +21 -0
- package/docs/models/shared/incrementledgerentryentrystatus.md +9 -0
- package/docs/models/shared/incrementledgerentryentrytype.md +8 -0
- package/docs/models/shared/ingestevent.md +13 -0
- package/docs/models/shared/ingesteventproperties.md +9 -0
- package/docs/models/shared/ingestionresponse.md +9 -0
- package/docs/models/shared/ingestrequestbody.md +8 -0
- package/docs/models/shared/invoice.md +51 -0
- package/docs/models/shared/invoicelineitem.md +23 -0
- package/docs/models/shared/invoicelineitemparams.md +14 -0
- package/docs/models/shared/invoicelineitemparamsmodeltype.md +8 -0
- package/docs/models/shared/invoicemetadata.md +7 -0
- package/docs/models/shared/invoiceminified.md +8 -0
- package/docs/models/shared/invoices.md +9 -0
- package/docs/models/shared/invoicestatus.md +12 -0
- package/docs/models/shared/item.md +14 -0
- package/docs/models/shared/itemexternalconnection.md +9 -0
- package/docs/models/shared/itemexternalconnectionexternalconnectionnameexternalconnectionname.md +11 -0
- package/docs/models/shared/itemexternalconnectionexternalconnectionnameexternalconnectionname1.md +10 -0
- package/docs/models/shared/items.md +9 -0
- package/docs/models/shared/itemslim.md +9 -0
- package/docs/models/shared/markaspaidrequestparams.md +10 -0
- package/docs/models/shared/matrixconfig.md +11 -0
- package/docs/models/shared/matrixprice.md +225 -0
- package/docs/models/shared/matrixpricecadence.md +11 -0
- package/docs/models/shared/matrixpricemodeltype.md +8 -0
- package/docs/models/shared/matrixpricepricetype.md +9 -0
- package/docs/models/shared/matrixsublineitem.md +13 -0
- package/docs/models/shared/matrixsublineitemtype.md +8 -0
- package/docs/models/shared/matrixvalue.md +10 -0
- package/docs/models/shared/maximum.md +9 -0
- package/docs/models/shared/maximuminterval.md +12 -0
- package/docs/models/shared/metricgroup.md +9 -0
- package/docs/models/shared/minimum.md +9 -0
- package/docs/models/shared/minimuminterval.md +12 -0
- package/docs/models/shared/newaccountingsyncconfiguration.md +9 -0
- package/docs/models/shared/newbackfill.md +13 -0
- package/docs/models/shared/newbillablemetric.md +12 -0
- package/docs/models/shared/newbillablemetricmetadata.md +9 -0
- package/docs/models/shared/newbpsprice.md +18 -0
- package/docs/models/shared/newbpspricecadence.md +12 -0
- package/docs/models/shared/newbpspricemodeltype.md +8 -0
- package/docs/models/shared/newbulkbpsprice.md +18 -0
- package/docs/models/shared/newbulkbpspricecadence.md +12 -0
- package/docs/models/shared/newbulkbpspricemodeltype.md +8 -0
- package/docs/models/shared/newbulkprice.md +18 -0
- package/docs/models/shared/newbulkpricecadence.md +12 -0
- package/docs/models/shared/newbulkpricemodeltype.md +8 -0
- package/docs/models/shared/newcoupon.md +11 -0
- package/docs/models/shared/newcoupondiscount.md +7 -0
- package/docs/models/shared/newcustomer.md +23 -0
- package/docs/models/shared/newcustomerbalancetransaction.md +10 -0
- package/docs/models/shared/newcustomerbalancetransactiontype.md +9 -0
- package/docs/models/shared/newcustomermetadata.md +9 -0
- package/docs/models/shared/newcustomerpaymentprovider.md +14 -0
- package/docs/models/shared/newmatrixprice.md +18 -0
- package/docs/models/shared/newmatrixpricecadence.md +12 -0
- package/docs/models/shared/newmatrixpricemodeltype.md +8 -0
- package/docs/models/shared/newpackageprice.md +18 -0
- package/docs/models/shared/newpackagepricecadence.md +12 -0
- package/docs/models/shared/newpackagepricemodeltype.md +8 -0
- package/docs/models/shared/newpackagewithallocationprice.md +18 -0
- package/docs/models/shared/newpackagewithallocationpricecadence.md +12 -0
- package/docs/models/shared/newpackagewithallocationpricemodeltype.md +8 -0
- package/docs/models/shared/newplan.md +14 -0
- package/docs/models/shared/newplanmetadata.md +7 -0
- package/docs/models/shared/newplanprices.md +7 -0
- package/docs/models/shared/newreportingconfiguration.md +8 -0
- package/docs/models/shared/newsubscription.md +31 -0
- package/docs/models/shared/newsubscriptionexternalmarketplace.md +10 -0
- package/docs/models/shared/newsubscriptionmetadata.md +7 -0
- package/docs/models/shared/newthresholdtotalamountprice.md +18 -0
- package/docs/models/shared/newthresholdtotalamountpricecadence.md +12 -0
- package/docs/models/shared/newthresholdtotalamountpricemodeltype.md +8 -0
- package/docs/models/shared/newtieredbpsprice.md +18 -0
- package/docs/models/shared/newtieredbpspricecadence.md +12 -0
- package/docs/models/shared/newtieredbpspricemodeltype.md +8 -0
- package/docs/models/shared/newtieredpackageprice.md +18 -0
- package/docs/models/shared/newtieredpackagepricecadence.md +12 -0
- package/docs/models/shared/newtieredpackagepricemodeltype.md +8 -0
- package/docs/models/shared/newtieredprice.md +18 -0
- package/docs/models/shared/newtieredpricecadence.md +12 -0
- package/docs/models/shared/newtieredpricemodeltype.md +8 -0
- package/docs/models/shared/newtieredwithminimumprice.md +18 -0
- package/docs/models/shared/newtieredwithminimumpricecadence.md +12 -0
- package/docs/models/shared/newtieredwithminimumpricemodeltype.md +8 -0
- package/docs/models/shared/newunitprice.md +18 -0
- package/docs/models/shared/newunitpricecadence.md +12 -0
- package/docs/models/shared/newunitpricemodeltype.md +8 -0
- package/docs/models/shared/othersublineitem.md +12 -0
- package/docs/models/shared/othersublineitemtype.md +8 -0
- package/docs/models/shared/overridebpsprice.md +14 -0
- package/docs/models/shared/overridebpspricemodeltype.md +8 -0
- package/docs/models/shared/overridebulkbpsprice.md +14 -0
- package/docs/models/shared/overridebulkbpspricemodeltype.md +8 -0
- package/docs/models/shared/overridebulkprice.md +14 -0
- package/docs/models/shared/overridebulkpricemodeltype.md +8 -0
- package/docs/models/shared/overridefivetranexampleprice.md +14 -0
- package/docs/models/shared/overridefivetranexamplepricemodeltype.md +8 -0
- package/docs/models/shared/overridematrixprice.md +14 -0
- package/docs/models/shared/overridematrixpricemodeltype.md +8 -0
- package/docs/models/shared/overridepackageprice.md +14 -0
- package/docs/models/shared/overridepackagepricemodeltype.md +8 -0
- package/docs/models/shared/overridepackagewithallocationprice.md +14 -0
- package/docs/models/shared/overridepackagewithallocationpricemodeltype.md +8 -0
- package/docs/models/shared/overridetestratingfunctionprice.md +14 -0
- package/docs/models/shared/overridetestratingfunctionpricemodeltype.md +8 -0
- package/docs/models/shared/overridethresholdtotalamountprice.md +14 -0
- package/docs/models/shared/overridethresholdtotalamountpricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredbpsprice.md +14 -0
- package/docs/models/shared/overridetieredbpspricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredpackageprice.md +14 -0
- package/docs/models/shared/overridetieredpackagepricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredprice.md +14 -0
- package/docs/models/shared/overridetieredpricemodeltype.md +8 -0
- package/docs/models/shared/overridetieredwithminimumprice.md +14 -0
- package/docs/models/shared/overridetieredwithminimumpricemodeltype.md +8 -0
- package/docs/models/shared/overrideunitprice.md +14 -0
- package/docs/models/shared/overrideunitpricemodeltype.md +8 -0
- package/docs/models/shared/packageconfig.md +9 -0
- package/docs/models/shared/packageprice.md +225 -0
- package/docs/models/shared/packagepricecadence.md +11 -0
- package/docs/models/shared/packagepricemodeltype.md +8 -0
- package/docs/models/shared/packagepricepricetype.md +9 -0
- package/docs/models/shared/packagewithallocationprice.md +225 -0
- package/docs/models/shared/packagewithallocationpricecadence.md +11 -0
- package/docs/models/shared/packagewithallocationpricemodeltype.md +8 -0
- package/docs/models/shared/packagewithallocationpricepricetype.md +9 -0
- package/docs/models/shared/paginationmetadata.md +9 -0
- package/docs/models/shared/percentagediscount.md +10 -0
- package/docs/models/shared/percentagediscountcreationparams.md +9 -0
- package/docs/models/shared/percentagediscountcreationparamsdiscounttype.md +8 -0
- package/docs/models/shared/percentagediscountdiscounttype.md +8 -0
- package/docs/models/shared/percentagediscountinterval.md +13 -0
- package/docs/models/shared/percentagediscountintervaldiscounttype.md +8 -0
- package/docs/models/shared/perpricecost.md +12 -0
- package/docs/models/shared/phaseoverride.md +11 -0
- package/docs/models/shared/pingresponse.md +8 -0
- package/docs/models/shared/plan.md +33 -0
- package/docs/models/shared/planmetadata.md +7 -0
- package/docs/models/shared/planminified.md +10 -0
- package/docs/models/shared/planphase.md +18 -0
- package/docs/models/shared/planphasedurationunit.md +11 -0
- package/docs/models/shared/planprices.md +7 -0
- package/docs/models/shared/plans.md +9 -0
- package/docs/models/shared/planstatus.md +10 -0
- package/docs/models/shared/pricegroup.md +12 -0
- package/docs/models/shared/priceinterval.md +18 -0
- package/docs/models/shared/priceintervalfixedfeequantitytransitionparams.md +9 -0
- package/docs/models/shared/prices.md +9 -0
- package/docs/models/shared/product.md +10 -0
- package/docs/models/shared/reportingconfiguration.md +8 -0
- package/docs/models/shared/requesttoolargeerror.md +12 -0
- package/docs/models/shared/requesttoolargeerrorheaders.md +7 -0
- package/docs/models/shared/requesttoolargeerrorstatus.md +8 -0
- package/docs/models/shared/requesttoolargeerrortype.md +8 -0
- package/docs/models/shared/requestvalidationerror.md +13 -0
- package/docs/models/shared/requestvalidationerrorheaders.md +7 -0
- package/docs/models/shared/requestvalidationerrorstatus.md +8 -0
- package/docs/models/shared/requestvalidationerrortype.md +8 -0
- package/docs/models/shared/resourcenotfounderror.md +12 -0
- package/docs/models/shared/resourcenotfounderrorheaders.md +7 -0
- package/docs/models/shared/resourcenotfounderrorstatus.md +8 -0
- package/docs/models/shared/resourcenotfounderrortype.md +8 -0
- package/docs/models/shared/resourcetoolargeerror.md +12 -0
- package/docs/models/shared/resourcetoolargeerrorheaders.md +7 -0
- package/docs/models/shared/resourcetoolargeerrorstatus.md +8 -0
- package/docs/models/shared/resourcetoolargeerrortype.md +8 -0
- package/docs/models/shared/security.md +8 -0
- package/docs/models/shared/sublineitemgrouping.md +9 -0
- package/docs/models/shared/sublineitemmatrixconfig.md +8 -0
- package/docs/models/shared/subscription.md +44 -0
- package/docs/models/shared/subscriptioncosts.md +8 -0
- package/docs/models/shared/subscriptionmetadata.md +9 -0
- package/docs/models/shared/subscriptionminified.md +8 -0
- package/docs/models/shared/subscriptionplanchange.md +23 -0
- package/docs/models/shared/subscriptions.md +9 -0
- package/docs/models/shared/subscriptionscheduleitem.md +10 -0
- package/docs/models/shared/subscriptionscheduleitems.md +9 -0
- package/docs/models/shared/subscriptionstatus.md +10 -0
- package/docs/models/shared/subscriptiontrialinfo.md +8 -0
- package/docs/models/shared/taxamount.md +10 -0
- package/docs/models/shared/testratingfunctionprice.md +225 -0
- package/docs/models/shared/testratingfunctionpricecadence.md +11 -0
- package/docs/models/shared/testratingfunctionpricemodeltype.md +8 -0
- package/docs/models/shared/testratingfunctionpricepricetype.md +9 -0
- package/docs/models/shared/thresholdtotalamountprice.md +225 -0
- package/docs/models/shared/thresholdtotalamountpricecadence.md +11 -0
- package/docs/models/shared/thresholdtotalamountpricemodeltype.md +8 -0
- package/docs/models/shared/thresholdtotalamountpricepricetype.md +9 -0
- package/docs/models/shared/tier.md +10 -0
- package/docs/models/shared/tierconfig.md +10 -0
- package/docs/models/shared/tieredbpsconfig.md +8 -0
- package/docs/models/shared/tieredbpsprice.md +225 -0
- package/docs/models/shared/tieredbpspricecadence.md +11 -0
- package/docs/models/shared/tieredbpspricemodeltype.md +8 -0
- package/docs/models/shared/tieredbpspricepricetype.md +9 -0
- package/docs/models/shared/tieredconfig.md +8 -0
- package/docs/models/shared/tieredpackageprice.md +225 -0
- package/docs/models/shared/tieredpackagepricecadence.md +11 -0
- package/docs/models/shared/tieredpackagepricemodeltype.md +8 -0
- package/docs/models/shared/tieredpackagepricepricetype.md +9 -0
- package/docs/models/shared/tieredprice.md +225 -0
- package/docs/models/shared/tieredpricecadence.md +11 -0
- package/docs/models/shared/tieredpricemodeltype.md +8 -0
- package/docs/models/shared/tieredpricepricetype.md +9 -0
- package/docs/models/shared/tieredwithminimumprice.md +225 -0
- package/docs/models/shared/tieredwithminimumpricecadence.md +11 -0
- package/docs/models/shared/tieredwithminimumpricemodeltype.md +8 -0
- package/docs/models/shared/tieredwithminimumpricepricetype.md +9 -0
- package/docs/models/shared/tiersublineitem.md +13 -0
- package/docs/models/shared/tiersublineitemtype.md +8 -0
- package/docs/models/shared/trialconfig.md +9 -0
- package/docs/models/shared/trialconfigtrialperiodunit.md +8 -0
- package/docs/models/shared/trialdiscount.md +11 -0
- package/docs/models/shared/trialdiscountdiscounttype.md +8 -0
- package/docs/models/shared/triggersubscriptionphaseparams.md +8 -0
- package/docs/models/shared/ungroupedsubscriptionusage.md +8 -0
- package/docs/models/shared/ungroupedsubscriptionusagerecord.md +10 -0
- package/docs/models/shared/ungroupedsubscriptionusagerecordviewmode.md +9 -0
- package/docs/models/shared/unitconfig.md +9 -0
- package/docs/models/shared/unitprice.md +225 -0
- package/docs/models/shared/unitpricecadence.md +11 -0
- package/docs/models/shared/unitpricemodeltype.md +8 -0
- package/docs/models/shared/unitpricepricetype.md +9 -0
- package/docs/models/shared/unschedulefixedfeequantitychangeparams.md +8 -0
- package/docs/models/shared/upcominginvoice.md +46 -0
- package/docs/models/shared/upcominginvoicemetadata.md +7 -0
- package/docs/models/shared/upcominginvoicestatus.md +12 -0
- package/docs/models/shared/updateevent.md +12 -0
- package/docs/models/shared/updateeventproperties.md +9 -0
- package/docs/models/shared/urlnotfound.md +12 -0
- package/docs/models/shared/urlnotfoundheaders.md +7 -0
- package/docs/models/shared/urlnotfoundstatus.md +8 -0
- package/docs/models/shared/urlnotfoundtype.md +8 -0
- package/docs/models/shared/usage.md +10 -0
- package/docs/models/shared/usagediscount.md +10 -0
- package/docs/models/shared/usagediscountcreationparams.md +9 -0
- package/docs/models/shared/usagediscountcreationparamsdiscounttype.md +8 -0
- package/docs/models/shared/usagediscountdiscounttype.md +8 -0
- package/docs/models/shared/usagediscountinterval.md +13 -0
- package/docs/models/shared/usagediscountintervaldiscounttype.md +8 -0
- package/docs/models/shared/validationerror.md +9 -0
- package/docs/models/shared/voidinitiatedledgerentry.md +24 -0
- package/docs/models/shared/voidinitiatedledgerentryentrystatus.md +9 -0
- package/docs/models/shared/voidinitiatedledgerentryentrytype.md +8 -0
- package/docs/models/shared/voidledgerentry.md +23 -0
- package/docs/models/shared/voidledgerentryentrystatus.md +9 -0
- package/docs/models/shared/voidledgerentryentrytype.md +8 -0
- package/docs/sdks/availability/README.md +45 -0
- package/docs/sdks/coupon/README.md +226 -0
- package/docs/sdks/credit/README.md +605 -0
- package/docs/sdks/creditnote/README.md +91 -0
- package/docs/sdks/customer/README.md +1129 -0
- package/docs/sdks/event/README.md +674 -0
- package/docs/sdks/invoice/README.md +402 -0
- package/docs/sdks/item/README.md +89 -0
- package/docs/sdks/metric/README.md +140 -0
- package/docs/sdks/orb/README.md +21 -0
- package/docs/sdks/plan/README.md +300 -0
- package/docs/sdks/price/README.md +411 -0
- package/docs/sdks/priceinterval/README.md +180 -0
- package/docs/sdks/subscription/README.md +1412 -0
- package/docs/types/rfcdate.md +11 -0
- package/package.json +2 -1
- package/dist/sdk/models/operations/addledgerentryexternalid.d.ts +0 -16
- package/dist/sdk/models/operations/listcreditnote.d.ts +0 -34
- package/dist/sdk/models/shared/action.d.ts +0 -8
- package/dist/sdk/models/shared/action.js +0 -15
- package/dist/sdk/models/shared/billablemetricminified.d.ts +0 -5
- package/dist/sdk/models/shared/bpspriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/bulkbpspriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/bulkpriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/cadence.d.ts +0 -5
- package/dist/sdk/models/shared/cadence.js +0 -12
- package/dist/sdk/models/shared/canceloption.d.ts +0 -8
- package/dist/sdk/models/shared/canceloption.js +0 -15
- package/dist/sdk/models/shared/changeoption1.d.ts +0 -8
- package/dist/sdk/models/shared/changeoption1.js +0 -15
- package/dist/sdk/models/shared/credit.d.ts +0 -16
- package/dist/sdk/models/shared/creditblock.d.ts +0 -15
- package/dist/sdk/models/shared/creditledgerentry.d.ts +0 -58
- package/dist/sdk/models/shared/creditnotetype.d.ts +0 -7
- package/dist/sdk/models/shared/creditnotetype.js +0 -14
- package/dist/sdk/models/shared/customercost.d.ts +0 -15
- package/dist/sdk/models/shared/discounttype.d.ts +0 -6
- package/dist/sdk/models/shared/discounttype.js +0 -13
- package/dist/sdk/models/shared/durationunit.d.ts +0 -8
- package/dist/sdk/models/shared/durationunit.js +0 -15
- package/dist/sdk/models/shared/entrystatus.d.ts +0 -7
- package/dist/sdk/models/shared/entrystatus.js +0 -14
- package/dist/sdk/models/shared/entrytype.d.ts +0 -9
- package/dist/sdk/models/shared/entrytype.js +0 -16
- package/dist/sdk/models/shared/eventsearchresults.d.ts +0 -10
- package/dist/sdk/models/shared/externalmarketplace.d.ts +0 -8
- package/dist/sdk/models/shared/externalmarketplace.js +0 -15
- package/dist/sdk/models/shared/fixedfeequantityschedule.d.ts +0 -7
- package/dist/sdk/models/shared/granularity.d.ts +0 -6
- package/dist/sdk/models/shared/granularity.js +0 -13
- package/dist/sdk/models/shared/grouping.d.ts +0 -8
- package/dist/sdk/models/shared/invoicestatus.d.ts +0 -10
- package/dist/sdk/models/shared/invoicestatus.js +0 -17
- package/dist/sdk/models/shared/lineitem.d.ts +0 -58
- package/dist/sdk/models/shared/lineitem.js +0 -147
- package/dist/sdk/models/shared/matrixconfig1.d.ts +0 -10
- package/dist/sdk/models/shared/modeltype.d.ts +0 -10
- package/dist/sdk/models/shared/modeltype.js +0 -17
- package/dist/sdk/models/shared/newcreditledgerentry.d.ts +0 -44
- package/dist/sdk/models/shared/newtransaction.d.ts +0 -10
- package/dist/sdk/models/shared/packagepriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/price.d.ts +0 -114
- package/dist/sdk/models/shared/price.js +0 -245
- package/dist/sdk/models/shared/reason.d.ts +0 -9
- package/dist/sdk/models/shared/reason.js +0 -16
- package/dist/sdk/models/shared/sublineitem.d.ts +0 -32
- package/dist/sdk/models/shared/sublineitem1.d.ts +0 -24
- package/dist/sdk/models/shared/subscriptioncancellation.d.ts +0 -12
- package/dist/sdk/models/shared/subscriptionstatus.d.ts +0 -5
- package/dist/sdk/models/shared/subscriptionstatus.js +0 -12
- package/dist/sdk/models/shared/subscriptionusage.d.ts +0 -8
- package/dist/sdk/models/shared/tier7.d.ts +0 -7
- package/dist/sdk/models/shared/tieredbpsconfig1.d.ts +0 -5
- package/dist/sdk/models/shared/tieredbpspriceoverride.d.ts +0 -21
- package/dist/sdk/models/shared/tieredpriceoverride.d.ts +0 -27
- package/dist/sdk/models/shared/transactiontype.d.ts +0 -4
- package/dist/sdk/models/shared/transactiontype.js +0 -11
- package/dist/sdk/models/shared/type.d.ts +0 -7
- package/dist/sdk/models/shared/type.js +0 -14
- package/dist/sdk/models/shared/unitpriceoverride.d.ts +0 -24
- package/dist/sdk/models/shared/usageitem.d.ts +0 -6
- package/dist/sdk/models/shared/validationerrors.d.ts +0 -13
- package/dist/sdk/models/shared/validationerrors.js +0 -59
- package/dist/sdk/models/shared/viewmode.d.ts +0 -7
- package/dist/sdk/models/shared/viewmode.js +0 -14
package/dist/sdk/customer.js
CHANGED
|
@@ -91,6 +91,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
91
91
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
92
92
|
exports.Customer = void 0;
|
|
93
93
|
var utils = __importStar(require("../internal/utils"));
|
|
94
|
+
var errors = __importStar(require("./models/errors"));
|
|
94
95
|
var operations = __importStar(require("./models/operations"));
|
|
95
96
|
var shared = __importStar(require("./models/shared"));
|
|
96
97
|
/**
|
|
@@ -98,11 +99,18 @@ var shared = __importStar(require("./models/shared"));
|
|
|
98
99
|
*
|
|
99
100
|
* @remarks
|
|
100
101
|
*
|
|
101
|
-
* In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these
|
|
102
|
+
* In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these
|
|
103
|
+
* match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an
|
|
104
|
+
* `external_customer_id` with your own identifier. See
|
|
105
|
+
* [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) for further information about how these
|
|
106
|
+
* aliases work in Orb.
|
|
102
107
|
*
|
|
103
|
-
* In addition to having an identifier in your system, a customer may exist in a payment provider solution like
|
|
108
|
+
* In addition to having an identifier in your system, a customer may exist in a payment provider solution like
|
|
109
|
+
* Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping.
|
|
104
110
|
*
|
|
105
|
-
* A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which
|
|
111
|
+
* A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which
|
|
112
|
+
* defaults to your account's timezone. See [Timezone localization](../guides/product-catalog/timezones.md) for
|
|
113
|
+
* information on what this timezone parameter influences within Orb.
|
|
106
114
|
*/
|
|
107
115
|
var Customer = /** @class */ (function () {
|
|
108
116
|
function Customer(sdkConfig) {
|
|
@@ -114,63 +122,85 @@ var Customer = /** @class */ (function () {
|
|
|
114
122
|
* @remarks
|
|
115
123
|
* This endpoint is used to amend usage within a timeframe for a customer that has an active subscription.
|
|
116
124
|
*
|
|
117
|
-
* This endpoint will mark _all_ existing events within `[timeframe_start, timeframe_end)` as _ignored_ for billing
|
|
125
|
+
* This endpoint will mark _all_ existing events within `[timeframe_start, timeframe_end)` as _ignored_ for billing purpo
|
|
126
|
+
* ses, and Orb will only use the _new_ events passed in the body of this request as the source of truth for that timeframe
|
|
127
|
+
* moving forwards.
|
|
128
|
+
* Note that a given time period can be amended any number of times, so events can be overwritten in subsequent calls to th
|
|
129
|
+
* is endpoint.
|
|
118
130
|
*
|
|
119
131
|
* This is a powerful and audit-safe mechanism to retroactively change usage data in cases where you need to:
|
|
120
132
|
* - decrease historical usage consumption because of degraded service availability in your systems
|
|
121
133
|
* - account for gaps from your usage reporting mechanism
|
|
122
|
-
* - make point-in-time fixes for specific event records, while
|
|
123
|
-
*
|
|
134
|
+
* - make point-in-time fixes for specific event records, while ret
|
|
135
|
+
* aining the original time of usage and associated metadata.
|
|
124
136
|
* This amendment API is designed with two explicit goals:
|
|
125
|
-
* 1. Amendments are **always audit-safe**. The amendment process
|
|
126
|
-
*
|
|
127
|
-
*
|
|
137
|
+
* 1. Amendments are **always audit-safe**. The amendment process
|
|
138
|
+
* will still retain original events in the timeframe, though they will be ignored for billing calculations. For auditing a
|
|
139
|
+
* nd data fidelity purposes, Orb never overwrites or permanently deletes ingested usage data.
|
|
140
|
+
* 2. Amendments always preser
|
|
141
|
+
* ve data **consistency**. In other words, either an amendment is fully processed by the system (and the new events for th
|
|
142
|
+
* e timeframe are honored rather than the existing ones) or the amendment request fails. To maintain this important proper
|
|
143
|
+
* ty, Orb prevents _partial event ingestion_ on this endpoint.
|
|
128
144
|
*
|
|
129
145
|
* ## Response semantics
|
|
130
|
-
*
|
|
131
|
-
* - Any event that fails schema validation will lead to a `4xx` response. In this case, to maintain data consistency,
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
146
|
+
* - Either all events are ingested successfully, or all fail to ingest (returning a `4xx` or `5xx` response code).
|
|
147
|
+
* - Any event that fails schema validation will lead to a `4xx` response. In this case, to maintain data consistency,
|
|
148
|
+
* Orb will not ingest any events and will
|
|
149
|
+
* also not deprecate existing events in the time period.
|
|
150
|
+
* - You can assume that the amendment is successful on receipt of
|
|
151
|
+
* a `2xx` response.While a successful response from this endpoint indicates that the new events have been ingested, updati
|
|
152
|
+
* ng usage totals happens asynchronously and may be delayed by a few minutes.
|
|
153
|
+
*
|
|
154
|
+
* As emphasized above, Orb will never show
|
|
155
|
+
* an inconsistent state (e.g. in invoice previews or dashboards); either it will show the existing state (before the amend
|
|
156
|
+
* ment) or the new state (with new events in the requested timeframe).
|
|
136
157
|
*
|
|
137
158
|
* ## Sample request body
|
|
138
|
-
*
|
|
139
159
|
* ```json
|
|
140
160
|
* {
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
161
|
+
* "events": [{
|
|
162
|
+
* "event_name": "payment_processed",
|
|
163
|
+
* "timestamp": "2022-03-24T07:15:00Z",
|
|
164
|
+
* "properties": {
|
|
165
|
+
* "amount": 100
|
|
166
|
+
* }
|
|
167
|
+
* }, {
|
|
168
|
+
* "event_name": "payment_failed",
|
|
169
|
+
* "timestamp": "2022-03-24T07:15:00Z",
|
|
170
|
+
* "properties": {
|
|
171
|
+
* "amount": 100
|
|
172
|
+
* }
|
|
173
|
+
* }]
|
|
154
174
|
* }
|
|
155
175
|
* ```
|
|
156
176
|
*
|
|
157
177
|
* ## Request Validation
|
|
158
|
-
* - The `timestamp` of
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
178
|
+
* - The `timestamp` of
|
|
179
|
+
* each event reported must fall within the bounds of `timeframe_start` and `timeframe_end`. As with ingestion, all timesta
|
|
180
|
+
* mps must be sent in ISO8601 format with UTC timezone offset.
|
|
181
|
+
* - Orb **does not accept an `idempotency_key`** with each
|
|
182
|
+
* event in this endpoint, since the entirety of the event list must be ingested to ensure consistency. On retryable errors
|
|
183
|
+
* , you should retry the request in its entirety, and assume that the amendment operation has not succeeded until receipt
|
|
184
|
+
* of a `2xx`.
|
|
185
|
+
*
|
|
186
|
+
* - Both `timeframe_start` and `timeframe_end` must be timestamps in the past. Furthermore, Orb will genera
|
|
187
|
+
* lly validate that the `timeframe_start` and `timeframe_end` fall within the customer's _current_ subscription billing pe
|
|
188
|
+
* riod. However, Orb does allow amendments while in the grace period of the previous billing period; in this instance, the
|
|
189
|
+
* timeframe can start before the current period.
|
|
164
190
|
*
|
|
165
191
|
* ## API Limits
|
|
166
|
-
* Note that Orb does not currently enforce a hard rate-
|
|
192
|
+
* Note that Orb does not currently enforce a hard rate-
|
|
193
|
+
* limit for API usage or a maximum request payload size. Similar to the event ingestion API, this API is architected for h
|
|
194
|
+
* igh-throughput ingestion. It is also safe to _programmatically_ call this endpoint if your system can automatically dete
|
|
195
|
+
* ct a need for historical amendment.
|
|
167
196
|
*
|
|
168
|
-
* In order to overwrite timeframes with a very large number of events, we suggest using multiple calls with small adjacent
|
|
197
|
+
* In order to overwrite timeframes with a very large number of events, we suggest using multiple calls with small adjacent
|
|
198
|
+
* (e.g. every hour) timeframes.
|
|
169
199
|
*/
|
|
170
200
|
Customer.prototype.amend = function (req, config) {
|
|
171
201
|
var _a, _b;
|
|
172
202
|
return __awaiter(this, void 0, void 0, function () {
|
|
173
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
203
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
174
204
|
var _d;
|
|
175
205
|
return __generator(this, function (_e) {
|
|
176
206
|
switch (_e.label) {
|
|
@@ -180,24 +210,33 @@ var Customer = /** @class */ (function () {
|
|
|
180
210
|
}
|
|
181
211
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
182
212
|
url = utils.generateURL(baseURL, "/customers/{customer_id}/usage", req);
|
|
183
|
-
_c = __read([{},
|
|
213
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
184
214
|
try {
|
|
185
|
-
_d = __read(utils.serializeRequestBody(req, "
|
|
215
|
+
_d = __read(utils.serializeRequestBody(req, "updateEvent", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
186
216
|
}
|
|
187
217
|
catch (e) {
|
|
188
218
|
if (e instanceof Error) {
|
|
189
219
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
190
220
|
}
|
|
191
221
|
}
|
|
192
|
-
client = this.sdkConfiguration.
|
|
193
|
-
|
|
222
|
+
client = this.sdkConfiguration.defaultClient;
|
|
223
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
224
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
225
|
+
return [4 /*yield*/, globalSecurity()];
|
|
226
|
+
case 1:
|
|
227
|
+
globalSecurity = _e.sent();
|
|
228
|
+
_e.label = 2;
|
|
229
|
+
case 2:
|
|
230
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
231
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
232
|
+
}
|
|
233
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
234
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
194
235
|
queryParams = utils.serializeQueryParams(req);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
headers["Accept"] = "application/json;q=1, application/json;q=0";
|
|
198
|
-
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
236
|
+
headers["Accept"] = "application/json";
|
|
237
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
199
238
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "patch", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
200
|
-
case
|
|
239
|
+
case 3:
|
|
201
240
|
httpRes = _e.sent();
|
|
202
241
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
203
242
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -214,10 +253,64 @@ var Customer = /** @class */ (function () {
|
|
|
214
253
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
215
254
|
res.amendedUsage = utils.objectToClass(JSON.parse(decodedRes), shared.AmendedUsage);
|
|
216
255
|
}
|
|
256
|
+
else {
|
|
257
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
258
|
+
}
|
|
217
259
|
break;
|
|
218
260
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
219
261
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
220
|
-
res.
|
|
262
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
266
|
+
}
|
|
267
|
+
break;
|
|
268
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
269
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
270
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
274
|
+
}
|
|
275
|
+
break;
|
|
276
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
277
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
278
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
282
|
+
}
|
|
283
|
+
break;
|
|
284
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
285
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
286
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
290
|
+
}
|
|
291
|
+
break;
|
|
292
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
293
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
294
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
298
|
+
}
|
|
299
|
+
break;
|
|
300
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
301
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
302
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
306
|
+
}
|
|
307
|
+
break;
|
|
308
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
309
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
310
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
221
314
|
}
|
|
222
315
|
break;
|
|
223
316
|
}
|
|
@@ -230,12 +323,87 @@ var Customer = /** @class */ (function () {
|
|
|
230
323
|
* Amend usage by external ID
|
|
231
324
|
*
|
|
232
325
|
* @remarks
|
|
233
|
-
* This endpoint
|
|
326
|
+
* This endpoint is used to amend usage within a timeframe for a customer that has an active subscription.
|
|
327
|
+
*
|
|
328
|
+
* This endpoint will mark _all_ existing events within `[timeframe_start, timeframe_end)` as _ignored_ for billing purpo
|
|
329
|
+
* ses, and Orb will only use the _new_ events passed in the body of this request as the source of truth for that timeframe
|
|
330
|
+
* moving forwards.
|
|
331
|
+
* Note that a given time period can be amended any number of times, so events can be overwritten in subsequent calls to th
|
|
332
|
+
* is endpoint.
|
|
333
|
+
*
|
|
334
|
+
* This is a powerful and audit-safe mechanism to retroactively change usage data in cases where you need to:
|
|
335
|
+
* - decrease historical usage consumption because of degraded service availability in your systems
|
|
336
|
+
* - account for gaps from your usage reporting mechanism
|
|
337
|
+
* - make point-in-time fixes for specific event records, while ret
|
|
338
|
+
* aining the original time of usage and associated metadata.
|
|
339
|
+
* This amendment API is designed with two explicit goals:
|
|
340
|
+
* 1. Amendments are **always audit-safe**. The amendment process
|
|
341
|
+
* will still retain original events in the timeframe, though they will be ignored for billing calculations. For auditing a
|
|
342
|
+
* nd data fidelity purposes, Orb never overwrites or permanently deletes ingested usage data.
|
|
343
|
+
* 2. Amendments always preser
|
|
344
|
+
* ve data **consistency**. In other words, either an amendment is fully processed by the system (and the new events for th
|
|
345
|
+
* e timeframe are honored rather than the existing ones) or the amendment request fails. To maintain this important proper
|
|
346
|
+
* ty, Orb prevents _partial event ingestion_ on this endpoint.
|
|
347
|
+
*
|
|
348
|
+
* ## Response semantics
|
|
349
|
+
* - Either all events are ingested successfully, or all fail to ingest (returning a `4xx` or `5xx` response code).
|
|
350
|
+
* - Any event that fails schema validation will lead to a `4xx` response. In this case, to maintain data consistency,
|
|
351
|
+
* Orb will not ingest any events and will
|
|
352
|
+
* also not deprecate existing events in the time period.
|
|
353
|
+
* - You can assume that the amendment is successful on receipt of
|
|
354
|
+
* a `2xx` response.While a successful response from this endpoint indicates that the new events have been ingested, updati
|
|
355
|
+
* ng usage totals happens asynchronously and may be delayed by a few minutes.
|
|
356
|
+
*
|
|
357
|
+
* As emphasized above, Orb will never show
|
|
358
|
+
* an inconsistent state (e.g. in invoice previews or dashboards); either it will show the existing state (before the amend
|
|
359
|
+
* ment) or the new state (with new events in the requested timeframe).
|
|
360
|
+
*
|
|
361
|
+
* ## Sample request body
|
|
362
|
+
* ```json
|
|
363
|
+
* {
|
|
364
|
+
* "events": [{
|
|
365
|
+
* "event_name": "payment_processed",
|
|
366
|
+
* "timestamp": "2022-03-24T07:15:00Z",
|
|
367
|
+
* "properties": {
|
|
368
|
+
* "amount": 100
|
|
369
|
+
* }
|
|
370
|
+
* }, {
|
|
371
|
+
* "event_name": "payment_failed",
|
|
372
|
+
* "timestamp": "2022-03-24T07:15:00Z",
|
|
373
|
+
* "properties": {
|
|
374
|
+
* "amount": 100
|
|
375
|
+
* }
|
|
376
|
+
* }]
|
|
377
|
+
* }
|
|
378
|
+
* ```
|
|
379
|
+
*
|
|
380
|
+
* ## Request Validation
|
|
381
|
+
* - The `timestamp` of
|
|
382
|
+
* each event reported must fall within the bounds of `timeframe_start` and `timeframe_end`. As with ingestion, all timesta
|
|
383
|
+
* mps must be sent in ISO8601 format with UTC timezone offset.
|
|
384
|
+
* - Orb **does not accept an `idempotency_key`** with each
|
|
385
|
+
* event in this endpoint, since the entirety of the event list must be ingested to ensure consistency. On retryable errors
|
|
386
|
+
* , you should retry the request in its entirety, and assume that the amendment operation has not succeeded until receipt
|
|
387
|
+
* of a `2xx`.
|
|
388
|
+
*
|
|
389
|
+
* - Both `timeframe_start` and `timeframe_end` must be timestamps in the past. Furthermore, Orb will genera
|
|
390
|
+
* lly validate that the `timeframe_start` and `timeframe_end` fall within the customer's _current_ subscription billing pe
|
|
391
|
+
* riod. However, Orb does allow amendments while in the grace period of the previous billing period; in this instance, the
|
|
392
|
+
* timeframe can start before the current period.
|
|
393
|
+
*
|
|
394
|
+
* ## API Limits
|
|
395
|
+
* Note that Orb does not currently enforce a hard rate-
|
|
396
|
+
* limit for API usage or a maximum request payload size. Similar to the event ingestion API, this API is architected for h
|
|
397
|
+
* igh-throughput ingestion. It is also safe to _programmatically_ call this endpoint if your system can automatically dete
|
|
398
|
+
* ct a need for historical amendment.
|
|
399
|
+
*
|
|
400
|
+
* In order to overwrite timeframes with a very large number of events, we suggest using multiple calls with small adjacent
|
|
401
|
+
* (e.g. every hour) timeframes.
|
|
234
402
|
*/
|
|
235
403
|
Customer.prototype.amendByExternalId = function (req, config) {
|
|
236
404
|
var _a, _b;
|
|
237
405
|
return __awaiter(this, void 0, void 0, function () {
|
|
238
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
406
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
239
407
|
var _d;
|
|
240
408
|
return __generator(this, function (_e) {
|
|
241
409
|
switch (_e.label) {
|
|
@@ -245,24 +413,33 @@ var Customer = /** @class */ (function () {
|
|
|
245
413
|
}
|
|
246
414
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
247
415
|
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/usage", req);
|
|
248
|
-
_c = __read([{},
|
|
416
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
249
417
|
try {
|
|
250
|
-
_d = __read(utils.serializeRequestBody(req, "
|
|
418
|
+
_d = __read(utils.serializeRequestBody(req, "updateEvent", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
251
419
|
}
|
|
252
420
|
catch (e) {
|
|
253
421
|
if (e instanceof Error) {
|
|
254
422
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
255
423
|
}
|
|
256
424
|
}
|
|
257
|
-
client = this.sdkConfiguration.
|
|
258
|
-
|
|
425
|
+
client = this.sdkConfiguration.defaultClient;
|
|
426
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
427
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
428
|
+
return [4 /*yield*/, globalSecurity()];
|
|
429
|
+
case 1:
|
|
430
|
+
globalSecurity = _e.sent();
|
|
431
|
+
_e.label = 2;
|
|
432
|
+
case 2:
|
|
433
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
434
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
435
|
+
}
|
|
436
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
437
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
259
438
|
queryParams = utils.serializeQueryParams(req);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
headers["Accept"] = "application/json;q=1, application/json;q=0";
|
|
263
|
-
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
|
|
439
|
+
headers["Accept"] = "application/json";
|
|
440
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
264
441
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "patch", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
265
|
-
case
|
|
442
|
+
case 3:
|
|
266
443
|
httpRes = _e.sent();
|
|
267
444
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
268
445
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -279,10 +456,64 @@ var Customer = /** @class */ (function () {
|
|
|
279
456
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
280
457
|
res.amendedUsage = utils.objectToClass(JSON.parse(decodedRes), shared.AmendedUsage);
|
|
281
458
|
}
|
|
459
|
+
else {
|
|
460
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
461
|
+
}
|
|
282
462
|
break;
|
|
283
463
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
284
464
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
285
|
-
res.
|
|
465
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
469
|
+
}
|
|
470
|
+
break;
|
|
471
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
472
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
473
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
477
|
+
}
|
|
478
|
+
break;
|
|
479
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
480
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
481
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
485
|
+
}
|
|
486
|
+
break;
|
|
487
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
488
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
489
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
493
|
+
}
|
|
494
|
+
break;
|
|
495
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
496
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
497
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
501
|
+
}
|
|
502
|
+
break;
|
|
503
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
504
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
505
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
509
|
+
}
|
|
510
|
+
break;
|
|
511
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
512
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
513
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
286
517
|
}
|
|
287
518
|
break;
|
|
288
519
|
}
|
|
@@ -295,17 +526,21 @@ var Customer = /** @class */ (function () {
|
|
|
295
526
|
* Create customer
|
|
296
527
|
*
|
|
297
528
|
* @remarks
|
|
298
|
-
* This operation is used to create an Orb customer, who is party to the core billing relationship. See
|
|
529
|
+
* This operation is used to create an Orb customer, who is party to the core billing relationship. See
|
|
530
|
+
* [Customer](../guides/concepts#customer) for an overview of the customer resource.
|
|
299
531
|
*
|
|
300
532
|
* This endpoint is critical in the following Orb functionality:
|
|
301
|
-
* * Automated charges can be configured by setting `payment_provider` and `payment_provider_id` to automatically
|
|
302
|
-
*
|
|
303
|
-
* * [
|
|
533
|
+
* * Automated charges can be configured by setting `payment_provider` and `payment_provider_id` to automatically
|
|
534
|
+
* issue invoices
|
|
535
|
+
* * [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) can be configured by setting
|
|
536
|
+
* `external_customer_id`
|
|
537
|
+
* * [Timezone localization](../guides/product-catalog/timezones.md) can be configured on a per-customer basis by
|
|
538
|
+
* setting the `timezone` parameter
|
|
304
539
|
*/
|
|
305
540
|
Customer.prototype.create = function (req, config) {
|
|
306
541
|
var _a, _b;
|
|
307
542
|
return __awaiter(this, void 0, void 0, function () {
|
|
308
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
|
|
543
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
309
544
|
var _d;
|
|
310
545
|
return __generator(this, function (_e) {
|
|
311
546
|
switch (_e.label) {
|
|
@@ -315,7 +550,7 @@ var Customer = /** @class */ (function () {
|
|
|
315
550
|
}
|
|
316
551
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
317
552
|
url = baseURL.replace(/\/$/, "") + "/customers";
|
|
318
|
-
_c = __read([{},
|
|
553
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
319
554
|
try {
|
|
320
555
|
_d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
321
556
|
}
|
|
@@ -324,12 +559,23 @@ var Customer = /** @class */ (function () {
|
|
|
324
559
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
325
560
|
}
|
|
326
561
|
}
|
|
327
|
-
client = this.sdkConfiguration.
|
|
328
|
-
|
|
562
|
+
client = this.sdkConfiguration.defaultClient;
|
|
563
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
564
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
565
|
+
return [4 /*yield*/, globalSecurity()];
|
|
566
|
+
case 1:
|
|
567
|
+
globalSecurity = _e.sent();
|
|
568
|
+
_e.label = 2;
|
|
569
|
+
case 2:
|
|
570
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
571
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
572
|
+
}
|
|
573
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
574
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
329
575
|
headers["Accept"] = "application/json";
|
|
330
|
-
headers["user-agent"] =
|
|
576
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
331
577
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
332
|
-
case
|
|
578
|
+
case 3:
|
|
333
579
|
httpRes = _e.sent();
|
|
334
580
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
335
581
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -346,6 +592,65 @@ var Customer = /** @class */ (function () {
|
|
|
346
592
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
347
593
|
res.customer = utils.objectToClass(JSON.parse(decodedRes), shared.Customer);
|
|
348
594
|
}
|
|
595
|
+
else {
|
|
596
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
597
|
+
}
|
|
598
|
+
break;
|
|
599
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
600
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
601
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
602
|
+
}
|
|
603
|
+
else {
|
|
604
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
605
|
+
}
|
|
606
|
+
break;
|
|
607
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
608
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
609
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
613
|
+
}
|
|
614
|
+
break;
|
|
615
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
616
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
617
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
621
|
+
}
|
|
622
|
+
break;
|
|
623
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
624
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
625
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
629
|
+
}
|
|
630
|
+
break;
|
|
631
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
632
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
633
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
634
|
+
}
|
|
635
|
+
else {
|
|
636
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
637
|
+
}
|
|
638
|
+
break;
|
|
639
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
640
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
641
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
645
|
+
}
|
|
646
|
+
break;
|
|
647
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
648
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
649
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
653
|
+
}
|
|
349
654
|
break;
|
|
350
655
|
}
|
|
351
656
|
return [2 /*return*/, res];
|
|
@@ -357,12 +662,13 @@ var Customer = /** @class */ (function () {
|
|
|
357
662
|
* Create customer balance transaction
|
|
358
663
|
*
|
|
359
664
|
* @remarks
|
|
360
|
-
* Creates an immutable balance transaction that updates the customer's balance and returns back the newly created
|
|
665
|
+
* Creates an immutable balance transaction that updates the customer's balance and returns back the newly created
|
|
666
|
+
* transaction.
|
|
361
667
|
*/
|
|
362
668
|
Customer.prototype.createBalanceTransaction = function (req, config) {
|
|
363
669
|
var _a, _b;
|
|
364
670
|
return __awaiter(this, void 0, void 0, function () {
|
|
365
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
|
|
671
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
366
672
|
var _d;
|
|
367
673
|
return __generator(this, function (_e) {
|
|
368
674
|
switch (_e.label) {
|
|
@@ -372,21 +678,32 @@ var Customer = /** @class */ (function () {
|
|
|
372
678
|
}
|
|
373
679
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
374
680
|
url = utils.generateURL(baseURL, "/customers/{customer_id}/balance_transactions", req);
|
|
375
|
-
_c = __read([{},
|
|
681
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
376
682
|
try {
|
|
377
|
-
_d = __read(utils.serializeRequestBody(req, "
|
|
683
|
+
_d = __read(utils.serializeRequestBody(req, "newCustomerBalanceTransaction", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
378
684
|
}
|
|
379
685
|
catch (e) {
|
|
380
686
|
if (e instanceof Error) {
|
|
381
687
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
382
688
|
}
|
|
383
689
|
}
|
|
384
|
-
client = this.sdkConfiguration.
|
|
385
|
-
|
|
690
|
+
client = this.sdkConfiguration.defaultClient;
|
|
691
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
692
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
693
|
+
return [4 /*yield*/, globalSecurity()];
|
|
694
|
+
case 1:
|
|
695
|
+
globalSecurity = _e.sent();
|
|
696
|
+
_e.label = 2;
|
|
697
|
+
case 2:
|
|
698
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
699
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
700
|
+
}
|
|
701
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
702
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
386
703
|
headers["Accept"] = "application/json";
|
|
387
|
-
headers["user-agent"] =
|
|
704
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
388
705
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
389
|
-
case
|
|
706
|
+
case 3:
|
|
390
707
|
httpRes = _e.sent();
|
|
391
708
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
392
709
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -403,6 +720,65 @@ var Customer = /** @class */ (function () {
|
|
|
403
720
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
404
721
|
res.customerBalanceTransaction = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerBalanceTransaction);
|
|
405
722
|
}
|
|
723
|
+
else {
|
|
724
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
725
|
+
}
|
|
726
|
+
break;
|
|
727
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
728
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
729
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
733
|
+
}
|
|
734
|
+
break;
|
|
735
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
736
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
737
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
741
|
+
}
|
|
742
|
+
break;
|
|
743
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
744
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
745
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
749
|
+
}
|
|
750
|
+
break;
|
|
751
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
752
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
753
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
757
|
+
}
|
|
758
|
+
break;
|
|
759
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
760
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
761
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
762
|
+
}
|
|
763
|
+
else {
|
|
764
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
765
|
+
}
|
|
766
|
+
break;
|
|
767
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
768
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
769
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
773
|
+
}
|
|
774
|
+
break;
|
|
775
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
776
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
777
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
778
|
+
}
|
|
779
|
+
else {
|
|
780
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
781
|
+
}
|
|
406
782
|
break;
|
|
407
783
|
}
|
|
408
784
|
return [2 /*return*/, res];
|
|
@@ -414,9 +790,16 @@ var Customer = /** @class */ (function () {
|
|
|
414
790
|
* Delete customer
|
|
415
791
|
*
|
|
416
792
|
* @remarks
|
|
417
|
-
* This performs a deletion of this customer, its subscriptions, and its invoices.
|
|
793
|
+
* This performs a deletion of this customer, its subscriptions, and its invoices.
|
|
794
|
+
* This operation is irreversible. Note that this is a _soft_ deletion, but the data
|
|
795
|
+
* will be inaccessible through the API and Orb dashboard. For hard-deletion, please
|
|
796
|
+
* reach out to the Orb team directly.
|
|
418
797
|
*
|
|
419
|
-
* **Note**: This operation happens asynchronously and can be expected to take a
|
|
798
|
+
* **Note**: This operation happens asynchronously and can be expected to take a
|
|
799
|
+
* few minutes to propagate to related resources. However, querying for the customer on
|
|
800
|
+
* subsequent GET requests while deletion is in process will reflect its deletion with
|
|
801
|
+
* a `deleted: true` property. Once the customer deletion has been fully processed,
|
|
802
|
+
* the customer will not be returned in the API.
|
|
420
803
|
*
|
|
421
804
|
*
|
|
422
805
|
* On successful processing, this returns an empty dictionary (`{}`) in the API.
|
|
@@ -424,7 +807,7 @@ var Customer = /** @class */ (function () {
|
|
|
424
807
|
Customer.prototype.delete = function (req, config) {
|
|
425
808
|
var _a, _b;
|
|
426
809
|
return __awaiter(this, void 0, void 0, function () {
|
|
427
|
-
var baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
|
|
810
|
+
var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
428
811
|
return __generator(this, function (_c) {
|
|
429
812
|
switch (_c.label) {
|
|
430
813
|
case 0:
|
|
@@ -433,12 +816,23 @@ var Customer = /** @class */ (function () {
|
|
|
433
816
|
}
|
|
434
817
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
435
818
|
url = utils.generateURL(baseURL, "/customers/{customer_id}", req);
|
|
436
|
-
client = this.sdkConfiguration.
|
|
437
|
-
|
|
819
|
+
client = this.sdkConfiguration.defaultClient;
|
|
820
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
821
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
822
|
+
return [4 /*yield*/, globalSecurity()];
|
|
823
|
+
case 1:
|
|
824
|
+
globalSecurity = _c.sent();
|
|
825
|
+
_c.label = 2;
|
|
826
|
+
case 2:
|
|
827
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
828
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
829
|
+
}
|
|
830
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
831
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
438
832
|
headers["Accept"] = "application/json";
|
|
439
|
-
headers["user-agent"] =
|
|
833
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
440
834
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
|
|
441
|
-
case
|
|
835
|
+
case 3:
|
|
442
836
|
httpRes = _c.sent();
|
|
443
837
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
444
838
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -453,7 +847,66 @@ var Customer = /** @class */ (function () {
|
|
|
453
847
|
switch (true) {
|
|
454
848
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 204:
|
|
455
849
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
456
|
-
res.
|
|
850
|
+
res.deleteCustomerResponse = utils.objectToClass(JSON.parse(decodedRes), shared.DeleteCustomerResponse);
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
854
|
+
}
|
|
855
|
+
break;
|
|
856
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
857
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
858
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
862
|
+
}
|
|
863
|
+
break;
|
|
864
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
865
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
866
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
867
|
+
}
|
|
868
|
+
else {
|
|
869
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
870
|
+
}
|
|
871
|
+
break;
|
|
872
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
873
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
874
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
878
|
+
}
|
|
879
|
+
break;
|
|
880
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
881
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
882
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
886
|
+
}
|
|
887
|
+
break;
|
|
888
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
889
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
890
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
894
|
+
}
|
|
895
|
+
break;
|
|
896
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
897
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
898
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
902
|
+
}
|
|
903
|
+
break;
|
|
904
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
905
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
906
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
907
|
+
}
|
|
908
|
+
else {
|
|
909
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
457
910
|
}
|
|
458
911
|
break;
|
|
459
912
|
}
|
|
@@ -466,15 +919,15 @@ var Customer = /** @class */ (function () {
|
|
|
466
919
|
* Fetch customer
|
|
467
920
|
*
|
|
468
921
|
* @remarks
|
|
469
|
-
* This endpoint is used to fetch customer details given an identifier. If the `Customer` is in the process of being deleted,
|
|
922
|
+
* This endpoint is used to fetch customer details given an identifier. If the `Customer` is in the process of being deleted,
|
|
923
|
+
* only the properties `id` and `deleted: true` will be returned.
|
|
470
924
|
*
|
|
471
925
|
* See the [Customer resource](../guides/core-concepts.mdx#customer) for a full discussion of the Customer model.
|
|
472
|
-
*
|
|
473
926
|
*/
|
|
474
927
|
Customer.prototype.fetch = function (req, config) {
|
|
475
928
|
var _a, _b;
|
|
476
929
|
return __awaiter(this, void 0, void 0, function () {
|
|
477
|
-
var baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
|
|
930
|
+
var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
478
931
|
return __generator(this, function (_c) {
|
|
479
932
|
switch (_c.label) {
|
|
480
933
|
case 0:
|
|
@@ -483,12 +936,23 @@ var Customer = /** @class */ (function () {
|
|
|
483
936
|
}
|
|
484
937
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
485
938
|
url = utils.generateURL(baseURL, "/customers/{customer_id}", req);
|
|
486
|
-
client = this.sdkConfiguration.
|
|
487
|
-
|
|
939
|
+
client = this.sdkConfiguration.defaultClient;
|
|
940
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
941
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
942
|
+
return [4 /*yield*/, globalSecurity()];
|
|
943
|
+
case 1:
|
|
944
|
+
globalSecurity = _c.sent();
|
|
945
|
+
_c.label = 2;
|
|
946
|
+
case 2:
|
|
947
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
948
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
949
|
+
}
|
|
950
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
951
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
488
952
|
headers["Accept"] = "application/json";
|
|
489
|
-
headers["user-agent"] =
|
|
953
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
490
954
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
491
|
-
case
|
|
955
|
+
case 3:
|
|
492
956
|
httpRes = _c.sent();
|
|
493
957
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
494
958
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -501,10 +965,69 @@ var Customer = /** @class */ (function () {
|
|
|
501
965
|
});
|
|
502
966
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
503
967
|
switch (true) {
|
|
504
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) ==
|
|
968
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
505
969
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
506
970
|
res.customer = utils.objectToClass(JSON.parse(decodedRes), shared.Customer);
|
|
507
971
|
}
|
|
972
|
+
else {
|
|
973
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
974
|
+
}
|
|
975
|
+
break;
|
|
976
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
977
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
978
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
979
|
+
}
|
|
980
|
+
else {
|
|
981
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
982
|
+
}
|
|
983
|
+
break;
|
|
984
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
985
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
986
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
987
|
+
}
|
|
988
|
+
else {
|
|
989
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
990
|
+
}
|
|
991
|
+
break;
|
|
992
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
993
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
994
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
998
|
+
}
|
|
999
|
+
break;
|
|
1000
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1001
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1002
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1003
|
+
}
|
|
1004
|
+
else {
|
|
1005
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1006
|
+
}
|
|
1007
|
+
break;
|
|
1008
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1009
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1010
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1014
|
+
}
|
|
1015
|
+
break;
|
|
1016
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1017
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1018
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1022
|
+
}
|
|
1023
|
+
break;
|
|
1024
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1025
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1026
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1027
|
+
}
|
|
1028
|
+
else {
|
|
1029
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1030
|
+
}
|
|
508
1031
|
break;
|
|
509
1032
|
}
|
|
510
1033
|
return [2 /*return*/, res];
|
|
@@ -516,14 +1039,15 @@ var Customer = /** @class */ (function () {
|
|
|
516
1039
|
* Fetch customer by external ID
|
|
517
1040
|
*
|
|
518
1041
|
* @remarks
|
|
519
|
-
* This endpoint is used to fetch customer details given an `external_customer_id` (see
|
|
1042
|
+
* This endpoint is used to fetch customer details given an `external_customer_id` (see
|
|
1043
|
+
* [Customer ID Aliases](../guides/events-and-metrics/customer-aliases)).
|
|
520
1044
|
*
|
|
521
1045
|
* Note that the resource and semantics of this endpoint exactly mirror [Get Customer](fetch-customer).
|
|
522
1046
|
*/
|
|
523
1047
|
Customer.prototype.fetchByExternalId = function (req, config) {
|
|
524
1048
|
var _a, _b;
|
|
525
1049
|
return __awaiter(this, void 0, void 0, function () {
|
|
526
|
-
var baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
|
|
1050
|
+
var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
527
1051
|
return __generator(this, function (_c) {
|
|
528
1052
|
switch (_c.label) {
|
|
529
1053
|
case 0:
|
|
@@ -532,12 +1056,23 @@ var Customer = /** @class */ (function () {
|
|
|
532
1056
|
}
|
|
533
1057
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
534
1058
|
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}", req);
|
|
535
|
-
client = this.sdkConfiguration.
|
|
536
|
-
|
|
1059
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1060
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1061
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1062
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1063
|
+
case 1:
|
|
1064
|
+
globalSecurity = _c.sent();
|
|
1065
|
+
_c.label = 2;
|
|
1066
|
+
case 2:
|
|
1067
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1068
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1069
|
+
}
|
|
1070
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1071
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
537
1072
|
headers["Accept"] = "application/json";
|
|
538
|
-
headers["user-agent"] =
|
|
1073
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
539
1074
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
540
|
-
case
|
|
1075
|
+
case 3:
|
|
541
1076
|
httpRes = _c.sent();
|
|
542
1077
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
543
1078
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -554,6 +1089,65 @@ var Customer = /** @class */ (function () {
|
|
|
554
1089
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
555
1090
|
res.customer = utils.objectToClass(JSON.parse(decodedRes), shared.Customer);
|
|
556
1091
|
}
|
|
1092
|
+
else {
|
|
1093
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1094
|
+
}
|
|
1095
|
+
break;
|
|
1096
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
1097
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1098
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
1099
|
+
}
|
|
1100
|
+
else {
|
|
1101
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1102
|
+
}
|
|
1103
|
+
break;
|
|
1104
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
1105
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1106
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
1107
|
+
}
|
|
1108
|
+
else {
|
|
1109
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1110
|
+
}
|
|
1111
|
+
break;
|
|
1112
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
1113
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1114
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
1115
|
+
}
|
|
1116
|
+
else {
|
|
1117
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1118
|
+
}
|
|
1119
|
+
break;
|
|
1120
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1121
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1122
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1123
|
+
}
|
|
1124
|
+
else {
|
|
1125
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1126
|
+
}
|
|
1127
|
+
break;
|
|
1128
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1129
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1130
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1131
|
+
}
|
|
1132
|
+
else {
|
|
1133
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1134
|
+
}
|
|
1135
|
+
break;
|
|
1136
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1137
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1138
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1142
|
+
}
|
|
1143
|
+
break;
|
|
1144
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1145
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1146
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1147
|
+
}
|
|
1148
|
+
else {
|
|
1149
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1150
|
+
}
|
|
557
1151
|
break;
|
|
558
1152
|
}
|
|
559
1153
|
return [2 /*return*/, res];
|
|
@@ -565,30 +1159,47 @@ var Customer = /** @class */ (function () {
|
|
|
565
1159
|
* Fetch customer costs
|
|
566
1160
|
*
|
|
567
1161
|
* @remarks
|
|
568
|
-
* This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing
|
|
1162
|
+
* This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing
|
|
1163
|
+
* information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage.api.mdx) to
|
|
1164
|
+
* fetch usage per metric, in usage units rather than a currency).
|
|
569
1165
|
*
|
|
570
|
-
* This endpoint can be leveraged for internal tooling and to provide a more transparent billing experience for your
|
|
1166
|
+
* This endpoint can be leveraged for internal tooling and to provide a more transparent billing experience for your
|
|
1167
|
+
* end users:
|
|
571
1168
|
*
|
|
572
1169
|
* 1. Understand the cost breakdown per line item historically and in real-time for the current billing period.
|
|
573
|
-
* 2. Provide customer visibility into how different services are contributing to the overall invoice with a per-day
|
|
574
|
-
*
|
|
1170
|
+
* 2. Provide customer visibility into how different services are contributing to the overall invoice with a per-day
|
|
1171
|
+
* timeseries (as compared to the [upcoming invoice](fetch-upcoming-invoice) resource, which represents a snapshot
|
|
1172
|
+
* for the current period).
|
|
1173
|
+
* 3. Assess how minimums and discounts affect your customers by teasing apart costs directly as a result of usage,
|
|
1174
|
+
* as opposed to minimums and discounts at the plan and price level.
|
|
575
1175
|
* 4. Gain insight into key customer health metrics, such as the percent utilization of the minimum committed spend.
|
|
576
1176
|
*
|
|
577
1177
|
* ## Fetching subscriptions
|
|
578
|
-
* By default, this endpoint fetches the currently active subscription for the customer, and returns cost information
|
|
579
|
-
*
|
|
580
|
-
*
|
|
1178
|
+
* By default, this endpoint fetches the currently active subscription for the customer, and returns cost information
|
|
1179
|
+
* for the subscription's current billing period, broken down by each participating price. If there are no currently
|
|
1180
|
+
* active subscriptions, this will instead default to the most recently active subscription or return an empty series
|
|
1181
|
+
* if none are found. For example, if your plan charges for compute hours, job runs, and data syncs, then this endpoint
|
|
1182
|
+
* would provide a daily breakdown of your customer's cost for each of those axes.
|
|
581
1183
|
*
|
|
1184
|
+
* If timeframe bounds are specified, Orb fetches all subscriptions that were active in that timeframe. If two
|
|
1185
|
+
* subscriptions overlap on a single day, costs from each price will be summed, and prices for both subscriptions will
|
|
1186
|
+
* be included in the breakdown.
|
|
582
1187
|
*
|
|
583
1188
|
* ## Prepaid plans
|
|
584
|
-
* For plans that include prices which deduct credits rather than accrue in-arrears charges in a billable currency,
|
|
585
|
-
*
|
|
1189
|
+
* For plans that include prices which deduct credits rather than accrue in-arrears charges in a billable currency,
|
|
1190
|
+
* this endpoint will return the total deduction amount, in credits, for the specified timeframe.
|
|
586
1191
|
*
|
|
587
1192
|
* ## Cumulative subtotals and totals
|
|
1193
|
+
* Since the subtotal and total must factor in any billing-period level discounts and minimums, it's most meaningful
|
|
1194
|
+
* to consider costs relative to the start of the subscription's billing period. As a result, by default this endpoint
|
|
1195
|
+
* returns cumulative totals since the beginning of the billing period. In particular, the `timeframe_start` of a
|
|
1196
|
+
* returned timeframe window is *always* the beginning of the billing period and `timeframe_end` is incremented one day
|
|
1197
|
+
* at a time to build the result.
|
|
588
1198
|
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
1199
|
+
* A customer that uses a few API calls a day but has a minimum commitment might exhibit the following pattern for
|
|
1200
|
+
* their subtotal and total in the first few days of the month. Here, we assume that each API call is $2.50, the
|
|
1201
|
+
* customer's plan has a monthly minimum of $50 for this price, and that the subscription's billing period bounds are
|
|
1202
|
+
* aligned to the first of the month:
|
|
592
1203
|
*
|
|
593
1204
|
* | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) |
|
|
594
1205
|
* | -----------| ----------- | ----------- | ----------- |----------- |
|
|
@@ -598,16 +1209,29 @@ var Customer = /** @class */ (function () {
|
|
|
598
1209
|
* | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 |
|
|
599
1210
|
* | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 |
|
|
600
1211
|
*
|
|
601
|
-
*
|
|
602
1212
|
* ### Periodic values
|
|
603
|
-
* When the query parameter `view_mode=periodic` is specified, Orb will return an incremental day-by-day view of costs.
|
|
1213
|
+
* When the query parameter `view_mode=periodic` is specified, Orb will return an incremental day-by-day view of costs.
|
|
1214
|
+
* In this case, there will always be a one-day difference between `timeframe_start` and `timeframe_end` for the
|
|
1215
|
+
* timeframes returned. This is a transform on top of the cumulative costs, calculated by taking the difference of each
|
|
1216
|
+
* timeframe with the last. Note that in the above example, the `Total` value would be 0 for the second two data
|
|
1217
|
+
* points, since the minimum commitment has not yet been hit and each day is not contributing anything to the total
|
|
1218
|
+
* cost.
|
|
604
1219
|
*
|
|
605
1220
|
* ## Timeframe bounds
|
|
606
|
-
* If no timeframe bounds are specified, the response will default to the current billing period for the customer's
|
|
1221
|
+
* If no timeframe bounds are specified, the response will default to the current billing period for the customer's
|
|
1222
|
+
* subscription. For subscriptions that have ended, this will be the billing period when they were last active. If the
|
|
1223
|
+
* subscription starts or ends within the timeframe, the response will only include windows where the subscription is
|
|
1224
|
+
* active.
|
|
607
1225
|
*
|
|
608
|
-
* As noted above, `timeframe_start` for a given cumulative datapoint is always the beginning of the billing period,
|
|
1226
|
+
* As noted above, `timeframe_start` for a given cumulative datapoint is always the beginning of the billing period,
|
|
1227
|
+
* and `timeframe_end` is incremented one day at a time to construct the response. When a timeframe is passed in that
|
|
1228
|
+
* is not aligned to the current subscription's billing period, the response will contain cumulative totals from
|
|
1229
|
+
* multiple billing periods.
|
|
609
1230
|
*
|
|
610
|
-
* Suppose the queried customer has a subscription aligned to the 15th of every month. If this endpoint is queried with
|
|
1231
|
+
* Suppose the queried customer has a subscription aligned to the 15th of every month. If this endpoint is queried with
|
|
1232
|
+
* the date range `2023-06-01` - `2023-07-01`, the first data point will represent about half a billing period's worth
|
|
1233
|
+
* of costs, accounting for accruals from the start of the billing period and inclusive of the first day of the
|
|
1234
|
+
* timeframe (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end = 2023-06-02 00:00:00`)
|
|
611
1235
|
*
|
|
612
1236
|
* | datapoint index | timeframe_start | timeframe_end |
|
|
613
1237
|
* | ----------- | -----------| ----------- |
|
|
@@ -623,20 +1247,26 @@ var Customer = /** @class */ (function () {
|
|
|
623
1247
|
* You can see this sliced timeframe visualized [here](https://i.imgur.com/TXhYgme.png).
|
|
624
1248
|
*
|
|
625
1249
|
* ## Grouping by custom attributes
|
|
626
|
-
* In order to view costs grouped by a specific _attribute_ that each event is tagged with (i.e. `cluster`), you can
|
|
1250
|
+
* In order to view costs grouped by a specific _attribute_ that each event is tagged with (i.e. `cluster`), you can
|
|
1251
|
+
* additionally specify a `group_by` key. The `group_by` key denotes the event property on which to group.
|
|
627
1252
|
*
|
|
628
|
-
* When returning grouped costs, a separate `price_group` object in the `per_price_costs` array is returned for each
|
|
1253
|
+
* When returning grouped costs, a separate `price_group` object in the `per_price_costs` array is returned for each
|
|
1254
|
+
* value of the `group_by` key present in your events. The `subtotal` value of the `per_price_costs` object is the sum
|
|
1255
|
+
* of each `price_group`'s total.
|
|
629
1256
|
*
|
|
630
|
-
* Orb expects events will contain values in the `properties` dictionary that correspond to the `group_by` key
|
|
1257
|
+
* Orb expects events will contain values in the `properties` dictionary that correspond to the `group_by` key
|
|
1258
|
+
* specified. By default, Orb will return a `null` group (i.e. events that match the metric but do not have the key
|
|
1259
|
+
* set). Currently, it is only possible to view costs grouped by a single attribute at a time.
|
|
631
1260
|
*
|
|
632
1261
|
* ### Matrix prices
|
|
633
|
-
* When a price uses matrix pricing, it's important to view costs grouped by those matrix dimensions. Orb will return
|
|
634
|
-
*
|
|
1262
|
+
* When a price uses matrix pricing, it's important to view costs grouped by those matrix dimensions. Orb will return
|
|
1263
|
+
* `price_groups` with the `grouping_key` and `secondary_grouping_key` based on the matrix price definition, for each
|
|
1264
|
+
* `grouping_value` and `secondary_grouping_value` available.
|
|
635
1265
|
*/
|
|
636
1266
|
Customer.prototype.fetchCosts = function (req, config) {
|
|
637
1267
|
var _a, _b;
|
|
638
1268
|
return __awaiter(this, void 0, void 0, function () {
|
|
639
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
1269
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
640
1270
|
return __generator(this, function (_c) {
|
|
641
1271
|
switch (_c.label) {
|
|
642
1272
|
case 0:
|
|
@@ -645,13 +1275,24 @@ var Customer = /** @class */ (function () {
|
|
|
645
1275
|
}
|
|
646
1276
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
647
1277
|
url = utils.generateURL(baseURL, "/customers/{customer_id}/costs", req);
|
|
648
|
-
client = this.sdkConfiguration.
|
|
649
|
-
|
|
1278
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1279
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1280
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1281
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1282
|
+
case 1:
|
|
1283
|
+
globalSecurity = _c.sent();
|
|
1284
|
+
_c.label = 2;
|
|
1285
|
+
case 2:
|
|
1286
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1287
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1288
|
+
}
|
|
1289
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1290
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
650
1291
|
queryParams = utils.serializeQueryParams(req);
|
|
651
1292
|
headers["Accept"] = "application/json";
|
|
652
|
-
headers["user-agent"] =
|
|
1293
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
653
1294
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
654
|
-
case
|
|
1295
|
+
case 3:
|
|
655
1296
|
httpRes = _c.sent();
|
|
656
1297
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
657
1298
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -668,6 +1309,65 @@ var Customer = /** @class */ (function () {
|
|
|
668
1309
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
669
1310
|
res.customerCosts = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerCosts);
|
|
670
1311
|
}
|
|
1312
|
+
else {
|
|
1313
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1314
|
+
}
|
|
1315
|
+
break;
|
|
1316
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
1317
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1318
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
1319
|
+
}
|
|
1320
|
+
else {
|
|
1321
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1322
|
+
}
|
|
1323
|
+
break;
|
|
1324
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
1325
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1326
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
1327
|
+
}
|
|
1328
|
+
else {
|
|
1329
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1330
|
+
}
|
|
1331
|
+
break;
|
|
1332
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
1333
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1334
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
1335
|
+
}
|
|
1336
|
+
else {
|
|
1337
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1338
|
+
}
|
|
1339
|
+
break;
|
|
1340
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1341
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1342
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1343
|
+
}
|
|
1344
|
+
else {
|
|
1345
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1346
|
+
}
|
|
1347
|
+
break;
|
|
1348
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1349
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1350
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1351
|
+
}
|
|
1352
|
+
else {
|
|
1353
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1354
|
+
}
|
|
1355
|
+
break;
|
|
1356
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1357
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1358
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1359
|
+
}
|
|
1360
|
+
else {
|
|
1361
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1362
|
+
}
|
|
1363
|
+
break;
|
|
1364
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1365
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1366
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1367
|
+
}
|
|
1368
|
+
else {
|
|
1369
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1370
|
+
}
|
|
671
1371
|
break;
|
|
672
1372
|
}
|
|
673
1373
|
return [2 /*return*/, res];
|
|
@@ -679,12 +1379,114 @@ var Customer = /** @class */ (function () {
|
|
|
679
1379
|
* Fetch customer costs by external ID
|
|
680
1380
|
*
|
|
681
1381
|
* @remarks
|
|
682
|
-
* This endpoint
|
|
1382
|
+
* This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing
|
|
1383
|
+
* information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage.api.mdx) to
|
|
1384
|
+
* fetch usage per metric, in usage units rather than a currency).
|
|
1385
|
+
*
|
|
1386
|
+
* This endpoint can be leveraged for internal tooling and to provide a more transparent billing experience for your
|
|
1387
|
+
* end users:
|
|
1388
|
+
*
|
|
1389
|
+
* 1. Understand the cost breakdown per line item historically and in real-time for the current billing period.
|
|
1390
|
+
* 2. Provide customer visibility into how different services are contributing to the overall invoice with a per-day
|
|
1391
|
+
* timeseries (as compared to the [upcoming invoice](fetch-upcoming-invoice) resource, which represents a snapshot
|
|
1392
|
+
* for the current period).
|
|
1393
|
+
* 3. Assess how minimums and discounts affect your customers by teasing apart costs directly as a result of usage,
|
|
1394
|
+
* as opposed to minimums and discounts at the plan and price level.
|
|
1395
|
+
* 4. Gain insight into key customer health metrics, such as the percent utilization of the minimum committed spend.
|
|
1396
|
+
*
|
|
1397
|
+
* ## Fetching subscriptions
|
|
1398
|
+
* By default, this endpoint fetches the currently active subscription for the customer, and returns cost information
|
|
1399
|
+
* for the subscription's current billing period, broken down by each participating price. If there are no currently
|
|
1400
|
+
* active subscriptions, this will instead default to the most recently active subscription or return an empty series
|
|
1401
|
+
* if none are found. For example, if your plan charges for compute hours, job runs, and data syncs, then this endpoint
|
|
1402
|
+
* would provide a daily breakdown of your customer's cost for each of those axes.
|
|
1403
|
+
*
|
|
1404
|
+
* If timeframe bounds are specified, Orb fetches all subscriptions that were active in that timeframe. If two
|
|
1405
|
+
* subscriptions overlap on a single day, costs from each price will be summed, and prices for both subscriptions will
|
|
1406
|
+
* be included in the breakdown.
|
|
1407
|
+
*
|
|
1408
|
+
* ## Prepaid plans
|
|
1409
|
+
* For plans that include prices which deduct credits rather than accrue in-arrears charges in a billable currency,
|
|
1410
|
+
* this endpoint will return the total deduction amount, in credits, for the specified timeframe.
|
|
1411
|
+
*
|
|
1412
|
+
* ## Cumulative subtotals and totals
|
|
1413
|
+
* Since the subtotal and total must factor in any billing-period level discounts and minimums, it's most meaningful
|
|
1414
|
+
* to consider costs relative to the start of the subscription's billing period. As a result, by default this endpoint
|
|
1415
|
+
* returns cumulative totals since the beginning of the billing period. In particular, the `timeframe_start` of a
|
|
1416
|
+
* returned timeframe window is *always* the beginning of the billing period and `timeframe_end` is incremented one day
|
|
1417
|
+
* at a time to build the result.
|
|
1418
|
+
*
|
|
1419
|
+
* A customer that uses a few API calls a day but has a minimum commitment might exhibit the following pattern for
|
|
1420
|
+
* their subtotal and total in the first few days of the month. Here, we assume that each API call is $2.50, the
|
|
1421
|
+
* customer's plan has a monthly minimum of $50 for this price, and that the subscription's billing period bounds are
|
|
1422
|
+
* aligned to the first of the month:
|
|
1423
|
+
*
|
|
1424
|
+
* | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) |
|
|
1425
|
+
* | -----------| ----------- | ----------- | ----------- |----------- |
|
|
1426
|
+
* | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 |
|
|
1427
|
+
* | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 |
|
|
1428
|
+
* | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 |
|
|
1429
|
+
* | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 |
|
|
1430
|
+
* | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 |
|
|
1431
|
+
*
|
|
1432
|
+
* ### Periodic values
|
|
1433
|
+
* When the query parameter `view_mode=periodic` is specified, Orb will return an incremental day-by-day view of costs.
|
|
1434
|
+
* In this case, there will always be a one-day difference between `timeframe_start` and `timeframe_end` for the
|
|
1435
|
+
* timeframes returned. This is a transform on top of the cumulative costs, calculated by taking the difference of each
|
|
1436
|
+
* timeframe with the last. Note that in the above example, the `Total` value would be 0 for the second two data
|
|
1437
|
+
* points, since the minimum commitment has not yet been hit and each day is not contributing anything to the total
|
|
1438
|
+
* cost.
|
|
1439
|
+
*
|
|
1440
|
+
* ## Timeframe bounds
|
|
1441
|
+
* If no timeframe bounds are specified, the response will default to the current billing period for the customer's
|
|
1442
|
+
* subscription. For subscriptions that have ended, this will be the billing period when they were last active. If the
|
|
1443
|
+
* subscription starts or ends within the timeframe, the response will only include windows where the subscription is
|
|
1444
|
+
* active.
|
|
1445
|
+
*
|
|
1446
|
+
* As noted above, `timeframe_start` for a given cumulative datapoint is always the beginning of the billing period,
|
|
1447
|
+
* and `timeframe_end` is incremented one day at a time to construct the response. When a timeframe is passed in that
|
|
1448
|
+
* is not aligned to the current subscription's billing period, the response will contain cumulative totals from
|
|
1449
|
+
* multiple billing periods.
|
|
1450
|
+
*
|
|
1451
|
+
* Suppose the queried customer has a subscription aligned to the 15th of every month. If this endpoint is queried with
|
|
1452
|
+
* the date range `2023-06-01` - `2023-07-01`, the first data point will represent about half a billing period's worth
|
|
1453
|
+
* of costs, accounting for accruals from the start of the billing period and inclusive of the first day of the
|
|
1454
|
+
* timeframe (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end = 2023-06-02 00:00:00`)
|
|
1455
|
+
*
|
|
1456
|
+
* | datapoint index | timeframe_start | timeframe_end |
|
|
1457
|
+
* | ----------- | -----------| ----------- |
|
|
1458
|
+
* | 0 | 2023-05-15 | 2023-06-02 |
|
|
1459
|
+
* | 1 | 2023-05-15 | 2023-06-03 |
|
|
1460
|
+
* | 2 | ... | ... |
|
|
1461
|
+
* | 3 | 2023-05-15 | 2023-06-14 |
|
|
1462
|
+
* | 4 | 2023-06-15 | 2023-06-16 |
|
|
1463
|
+
* | 5 | 2023-06-15 | 2023-06-17 |
|
|
1464
|
+
* | 6 | ... | ... |
|
|
1465
|
+
* | 7 | 2023-06-15 | 2023-07-01 |
|
|
1466
|
+
*
|
|
1467
|
+
* You can see this sliced timeframe visualized [here](https://i.imgur.com/TXhYgme.png).
|
|
1468
|
+
*
|
|
1469
|
+
* ## Grouping by custom attributes
|
|
1470
|
+
* In order to view costs grouped by a specific _attribute_ that each event is tagged with (i.e. `cluster`), you can
|
|
1471
|
+
* additionally specify a `group_by` key. The `group_by` key denotes the event property on which to group.
|
|
1472
|
+
*
|
|
1473
|
+
* When returning grouped costs, a separate `price_group` object in the `per_price_costs` array is returned for each
|
|
1474
|
+
* value of the `group_by` key present in your events. The `subtotal` value of the `per_price_costs` object is the sum
|
|
1475
|
+
* of each `price_group`'s total.
|
|
1476
|
+
*
|
|
1477
|
+
* Orb expects events will contain values in the `properties` dictionary that correspond to the `group_by` key
|
|
1478
|
+
* specified. By default, Orb will return a `null` group (i.e. events that match the metric but do not have the key
|
|
1479
|
+
* set). Currently, it is only possible to view costs grouped by a single attribute at a time.
|
|
1480
|
+
*
|
|
1481
|
+
* ### Matrix prices
|
|
1482
|
+
* When a price uses matrix pricing, it's important to view costs grouped by those matrix dimensions. Orb will return
|
|
1483
|
+
* `price_groups` with the `grouping_key` and `secondary_grouping_key` based on the matrix price definition, for each
|
|
1484
|
+
* `grouping_value` and `secondary_grouping_value` available.
|
|
683
1485
|
*/
|
|
684
1486
|
Customer.prototype.fetchCostsByExternalId = function (req, config) {
|
|
685
1487
|
var _a, _b;
|
|
686
1488
|
return __awaiter(this, void 0, void 0, function () {
|
|
687
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
1489
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
688
1490
|
return __generator(this, function (_c) {
|
|
689
1491
|
switch (_c.label) {
|
|
690
1492
|
case 0:
|
|
@@ -693,13 +1495,24 @@ var Customer = /** @class */ (function () {
|
|
|
693
1495
|
}
|
|
694
1496
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
695
1497
|
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/costs", req);
|
|
696
|
-
client = this.sdkConfiguration.
|
|
697
|
-
|
|
1498
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1499
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1500
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1501
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1502
|
+
case 1:
|
|
1503
|
+
globalSecurity = _c.sent();
|
|
1504
|
+
_c.label = 2;
|
|
1505
|
+
case 2:
|
|
1506
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1507
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1508
|
+
}
|
|
1509
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1510
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
698
1511
|
queryParams = utils.serializeQueryParams(req);
|
|
699
1512
|
headers["Accept"] = "application/json";
|
|
700
|
-
headers["user-agent"] =
|
|
1513
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
701
1514
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
702
|
-
case
|
|
1515
|
+
case 3:
|
|
703
1516
|
httpRes = _c.sent();
|
|
704
1517
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
705
1518
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -716,6 +1529,65 @@ var Customer = /** @class */ (function () {
|
|
|
716
1529
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
717
1530
|
res.customerCosts = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerCosts);
|
|
718
1531
|
}
|
|
1532
|
+
else {
|
|
1533
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1534
|
+
}
|
|
1535
|
+
break;
|
|
1536
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
1537
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1538
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
1539
|
+
}
|
|
1540
|
+
else {
|
|
1541
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1542
|
+
}
|
|
1543
|
+
break;
|
|
1544
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
1545
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1546
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
1547
|
+
}
|
|
1548
|
+
else {
|
|
1549
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1550
|
+
}
|
|
1551
|
+
break;
|
|
1552
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
1553
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1554
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
1555
|
+
}
|
|
1556
|
+
else {
|
|
1557
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1558
|
+
}
|
|
1559
|
+
break;
|
|
1560
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1561
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1562
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1563
|
+
}
|
|
1564
|
+
else {
|
|
1565
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1566
|
+
}
|
|
1567
|
+
break;
|
|
1568
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1569
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1570
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1571
|
+
}
|
|
1572
|
+
else {
|
|
1573
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1574
|
+
}
|
|
1575
|
+
break;
|
|
1576
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1577
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1578
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1579
|
+
}
|
|
1580
|
+
else {
|
|
1581
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1582
|
+
}
|
|
1583
|
+
break;
|
|
1584
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1585
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1586
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1587
|
+
}
|
|
1588
|
+
else {
|
|
1589
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1590
|
+
}
|
|
719
1591
|
break;
|
|
720
1592
|
}
|
|
721
1593
|
return [2 /*return*/, res];
|
|
@@ -724,48 +1596,51 @@ var Customer = /** @class */ (function () {
|
|
|
724
1596
|
});
|
|
725
1597
|
};
|
|
726
1598
|
/**
|
|
727
|
-
* List
|
|
1599
|
+
* List customers
|
|
728
1600
|
*
|
|
729
1601
|
* @remarks
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
*
|
|
734
|
-
* If the balance is a positive value at the time of invoicing, it represents that the customer has credit that should be used to offset the amount due on the next issued invoice. In this case, Orb will automatically reduce the next invoice by the balance amount, and roll over any remaining balance if the invoice is fully discounted.
|
|
735
|
-
*
|
|
736
|
-
* If the balance is a negative value at the time of invoicing, Orb will increase the invoice's amount due with a positive adjustment, and reset the balance to 0.
|
|
737
|
-
*
|
|
738
|
-
* This endpoint retrieves all customer balance transactions in reverse chronological order for a single customer, providing a complete audit trail of all adjustments and invoice applications.
|
|
739
|
-
*
|
|
740
|
-
* ## Eligibility
|
|
1602
|
+
* This endpoint returns a list of all customers for an account.
|
|
1603
|
+
* The list of customers is ordered starting from the most recently created customer.
|
|
1604
|
+
* This endpoint follows Orb's [standardized pagination format](../reference/pagination).
|
|
741
1605
|
*
|
|
742
|
-
*
|
|
1606
|
+
* See [Customer](../guides/concepts#customer) for an overview of the customer model.
|
|
743
1607
|
*/
|
|
744
|
-
Customer.prototype.
|
|
1608
|
+
Customer.prototype.list = function (req, config) {
|
|
745
1609
|
var _a, _b;
|
|
746
1610
|
return __awaiter(this, void 0, void 0, function () {
|
|
747
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
1611
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
748
1612
|
return __generator(this, function (_c) {
|
|
749
1613
|
switch (_c.label) {
|
|
750
1614
|
case 0:
|
|
751
1615
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
752
|
-
req = new operations.
|
|
1616
|
+
req = new operations.ListCustomersRequest(req);
|
|
753
1617
|
}
|
|
754
1618
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
755
|
-
url =
|
|
756
|
-
client = this.sdkConfiguration.
|
|
757
|
-
|
|
1619
|
+
url = baseURL.replace(/\/$/, "") + "/customers";
|
|
1620
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1621
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1622
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1623
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1624
|
+
case 1:
|
|
1625
|
+
globalSecurity = _c.sent();
|
|
1626
|
+
_c.label = 2;
|
|
1627
|
+
case 2:
|
|
1628
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1629
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1630
|
+
}
|
|
1631
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1632
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
758
1633
|
queryParams = utils.serializeQueryParams(req);
|
|
759
1634
|
headers["Accept"] = "application/json";
|
|
760
|
-
headers["user-agent"] =
|
|
1635
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
761
1636
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
762
|
-
case
|
|
1637
|
+
case 3:
|
|
763
1638
|
httpRes = _c.sent();
|
|
764
1639
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
765
1640
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
766
1641
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
767
1642
|
}
|
|
768
|
-
res = new operations.
|
|
1643
|
+
res = new operations.ListCustomersResponse({
|
|
769
1644
|
statusCode: httpRes.status,
|
|
770
1645
|
contentType: contentType,
|
|
771
1646
|
rawResponse: httpRes,
|
|
@@ -774,7 +1649,66 @@ var Customer = /** @class */ (function () {
|
|
|
774
1649
|
switch (true) {
|
|
775
1650
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
776
1651
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
777
|
-
res.
|
|
1652
|
+
res.customers = utils.objectToClass(JSON.parse(decodedRes), shared.Customers);
|
|
1653
|
+
}
|
|
1654
|
+
else {
|
|
1655
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1656
|
+
}
|
|
1657
|
+
break;
|
|
1658
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
1659
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1660
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
1661
|
+
}
|
|
1662
|
+
else {
|
|
1663
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1664
|
+
}
|
|
1665
|
+
break;
|
|
1666
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
1667
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1668
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
1669
|
+
}
|
|
1670
|
+
else {
|
|
1671
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1672
|
+
}
|
|
1673
|
+
break;
|
|
1674
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
1675
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1676
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
1677
|
+
}
|
|
1678
|
+
else {
|
|
1679
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1680
|
+
}
|
|
1681
|
+
break;
|
|
1682
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1683
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1684
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1685
|
+
}
|
|
1686
|
+
else {
|
|
1687
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1688
|
+
}
|
|
1689
|
+
break;
|
|
1690
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1691
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1692
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1693
|
+
}
|
|
1694
|
+
else {
|
|
1695
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1696
|
+
}
|
|
1697
|
+
break;
|
|
1698
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1699
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1700
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1701
|
+
}
|
|
1702
|
+
else {
|
|
1703
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1704
|
+
}
|
|
1705
|
+
break;
|
|
1706
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1707
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1708
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1709
|
+
}
|
|
1710
|
+
else {
|
|
1711
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
778
1712
|
}
|
|
779
1713
|
break;
|
|
780
1714
|
}
|
|
@@ -784,40 +1718,68 @@ var Customer = /** @class */ (function () {
|
|
|
784
1718
|
});
|
|
785
1719
|
};
|
|
786
1720
|
/**
|
|
787
|
-
* List
|
|
1721
|
+
* List balance transactions
|
|
788
1722
|
*
|
|
789
1723
|
* @remarks
|
|
1724
|
+
* ## The customer balance
|
|
790
1725
|
*
|
|
1726
|
+
* The customer balance is an amount in the customer's currency, which Orb automatically applies to subsequent
|
|
1727
|
+
* invoices. This balance can be adjusted manually via Orb's webapp on the customer details page. You can use this
|
|
1728
|
+
* balance to provide a fixed mid-period credit to the customer. Commonly, this is done due to system downtime/SLA
|
|
1729
|
+
* violation, or an adhoc adjustment discussed with the customer.
|
|
791
1730
|
*
|
|
792
|
-
*
|
|
1731
|
+
* If the balance is a positive value at the time of invoicing, it represents that the customer has credit that should
|
|
1732
|
+
* be used to offset the amount due on the next issued invoice. In this case, Orb will automatically reduce the next
|
|
1733
|
+
* invoice by the balance amount, and roll over any remaining balance if the invoice is fully discounted.
|
|
793
1734
|
*
|
|
794
|
-
*
|
|
1735
|
+
* If the balance is a negative value at the time of invoicing, Orb will increase the invoice's amount due with a
|
|
1736
|
+
* positive adjustment, and reset the balance to 0.
|
|
1737
|
+
*
|
|
1738
|
+
* This endpoint retrieves all customer balance transactions in reverse chronological order for a single customer,
|
|
1739
|
+
* providing a complete audit trail of all adjustments and invoice applications.
|
|
1740
|
+
*
|
|
1741
|
+
* ## Eligibility
|
|
1742
|
+
*
|
|
1743
|
+
* The customer balance can only be applied to invoices or adjusted manually if invoices are not synced to a separate
|
|
1744
|
+
* invoicing provider. If a payment gateway such as Stripe is used, the balance will be applied to the invoice before
|
|
1745
|
+
* forwarding payment to the gateway.
|
|
795
1746
|
*/
|
|
796
|
-
Customer.prototype.
|
|
1747
|
+
Customer.prototype.listBalanceTransactions = function (req, config) {
|
|
797
1748
|
var _a, _b;
|
|
798
1749
|
return __awaiter(this, void 0, void 0, function () {
|
|
799
|
-
var baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
1750
|
+
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
800
1751
|
return __generator(this, function (_c) {
|
|
801
1752
|
switch (_c.label) {
|
|
802
1753
|
case 0:
|
|
803
1754
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
804
|
-
req = new operations.
|
|
1755
|
+
req = new operations.ListBalanceTransactionsRequest(req);
|
|
805
1756
|
}
|
|
806
1757
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
807
|
-
url =
|
|
808
|
-
client = this.sdkConfiguration.
|
|
809
|
-
|
|
1758
|
+
url = utils.generateURL(baseURL, "/customers/{customer_id}/balance_transactions", req);
|
|
1759
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1760
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1761
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1762
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1763
|
+
case 1:
|
|
1764
|
+
globalSecurity = _c.sent();
|
|
1765
|
+
_c.label = 2;
|
|
1766
|
+
case 2:
|
|
1767
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1768
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1769
|
+
}
|
|
1770
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1771
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
810
1772
|
queryParams = utils.serializeQueryParams(req);
|
|
811
1773
|
headers["Accept"] = "application/json";
|
|
812
|
-
headers["user-agent"] =
|
|
1774
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
813
1775
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
814
|
-
case
|
|
1776
|
+
case 3:
|
|
815
1777
|
httpRes = _c.sent();
|
|
816
1778
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
817
1779
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
818
1780
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
819
1781
|
}
|
|
820
|
-
res = new operations.
|
|
1782
|
+
res = new operations.ListBalanceTransactionsResponse({
|
|
821
1783
|
statusCode: httpRes.status,
|
|
822
1784
|
contentType: contentType,
|
|
823
1785
|
rawResponse: httpRes,
|
|
@@ -826,7 +1788,66 @@ var Customer = /** @class */ (function () {
|
|
|
826
1788
|
switch (true) {
|
|
827
1789
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
828
1790
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
829
|
-
res.
|
|
1791
|
+
res.customerBalanceTransactions = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerBalanceTransactions);
|
|
1792
|
+
}
|
|
1793
|
+
else {
|
|
1794
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1795
|
+
}
|
|
1796
|
+
break;
|
|
1797
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
1798
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1799
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
1800
|
+
}
|
|
1801
|
+
else {
|
|
1802
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1803
|
+
}
|
|
1804
|
+
break;
|
|
1805
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
1806
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1807
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
1808
|
+
}
|
|
1809
|
+
else {
|
|
1810
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1811
|
+
}
|
|
1812
|
+
break;
|
|
1813
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
1814
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1815
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
1816
|
+
}
|
|
1817
|
+
else {
|
|
1818
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1819
|
+
}
|
|
1820
|
+
break;
|
|
1821
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1822
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1823
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1824
|
+
}
|
|
1825
|
+
else {
|
|
1826
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1827
|
+
}
|
|
1828
|
+
break;
|
|
1829
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1830
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1831
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1832
|
+
}
|
|
1833
|
+
else {
|
|
1834
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1835
|
+
}
|
|
1836
|
+
break;
|
|
1837
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1838
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1839
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1840
|
+
}
|
|
1841
|
+
else {
|
|
1842
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1843
|
+
}
|
|
1844
|
+
break;
|
|
1845
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1846
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1847
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1848
|
+
}
|
|
1849
|
+
else {
|
|
1850
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
830
1851
|
}
|
|
831
1852
|
break;
|
|
832
1853
|
}
|
|
@@ -839,14 +1860,15 @@ var Customer = /** @class */ (function () {
|
|
|
839
1860
|
* Update customer by external ID
|
|
840
1861
|
*
|
|
841
1862
|
* @remarks
|
|
842
|
-
* This endpoint is used to update customer details given an `external_customer_id`
|
|
843
|
-
*
|
|
844
|
-
* Note that the resource and semantics of this
|
|
1863
|
+
* This endpoint is used to update customer details given an `external_customer_id`
|
|
1864
|
+
* (see [Customer ID Aliases](../guides/events-and-metrics/customer-aliases)).
|
|
1865
|
+
* Note that the resource and semantics of this
|
|
1866
|
+
* endpoint exactly mirror [Update Customer](update-customer).
|
|
845
1867
|
*/
|
|
846
1868
|
Customer.prototype.updateByExternalId = function (req, config) {
|
|
847
1869
|
var _a, _b;
|
|
848
1870
|
return __awaiter(this, void 0, void 0, function () {
|
|
849
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
|
|
1871
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
850
1872
|
var _d;
|
|
851
1873
|
return __generator(this, function (_e) {
|
|
852
1874
|
switch (_e.label) {
|
|
@@ -856,21 +1878,32 @@ var Customer = /** @class */ (function () {
|
|
|
856
1878
|
}
|
|
857
1879
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
858
1880
|
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}", req);
|
|
859
|
-
_c = __read([{},
|
|
1881
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
860
1882
|
try {
|
|
861
|
-
_d = __read(utils.serializeRequestBody(req, "
|
|
1883
|
+
_d = __read(utils.serializeRequestBody(req, "editCustomer", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
862
1884
|
}
|
|
863
1885
|
catch (e) {
|
|
864
1886
|
if (e instanceof Error) {
|
|
865
1887
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
866
1888
|
}
|
|
867
1889
|
}
|
|
868
|
-
client = this.sdkConfiguration.
|
|
869
|
-
|
|
1890
|
+
client = this.sdkConfiguration.defaultClient;
|
|
1891
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
1892
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
1893
|
+
return [4 /*yield*/, globalSecurity()];
|
|
1894
|
+
case 1:
|
|
1895
|
+
globalSecurity = _e.sent();
|
|
1896
|
+
_e.label = 2;
|
|
1897
|
+
case 2:
|
|
1898
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
1899
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
1900
|
+
}
|
|
1901
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
1902
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
870
1903
|
headers["Accept"] = "application/json";
|
|
871
|
-
headers["user-agent"] =
|
|
1904
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
872
1905
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
873
|
-
case
|
|
1906
|
+
case 3:
|
|
874
1907
|
httpRes = _e.sent();
|
|
875
1908
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
876
1909
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -887,6 +1920,65 @@ var Customer = /** @class */ (function () {
|
|
|
887
1920
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
888
1921
|
res.customer = utils.objectToClass(JSON.parse(decodedRes), shared.Customer);
|
|
889
1922
|
}
|
|
1923
|
+
else {
|
|
1924
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1925
|
+
}
|
|
1926
|
+
break;
|
|
1927
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
1928
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1929
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
1930
|
+
}
|
|
1931
|
+
else {
|
|
1932
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1933
|
+
}
|
|
1934
|
+
break;
|
|
1935
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
1936
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1937
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
1938
|
+
}
|
|
1939
|
+
else {
|
|
1940
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1941
|
+
}
|
|
1942
|
+
break;
|
|
1943
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
1944
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1945
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
1946
|
+
}
|
|
1947
|
+
else {
|
|
1948
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1949
|
+
}
|
|
1950
|
+
break;
|
|
1951
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
1952
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1953
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
1954
|
+
}
|
|
1955
|
+
else {
|
|
1956
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1957
|
+
}
|
|
1958
|
+
break;
|
|
1959
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
1960
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1961
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
1962
|
+
}
|
|
1963
|
+
else {
|
|
1964
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1965
|
+
}
|
|
1966
|
+
break;
|
|
1967
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
1968
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1969
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
1970
|
+
}
|
|
1971
|
+
else {
|
|
1972
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1973
|
+
}
|
|
1974
|
+
break;
|
|
1975
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1976
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
1977
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
1978
|
+
}
|
|
1979
|
+
else {
|
|
1980
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1981
|
+
}
|
|
890
1982
|
break;
|
|
891
1983
|
}
|
|
892
1984
|
return [2 /*return*/, res];
|
|
@@ -898,14 +1990,14 @@ var Customer = /** @class */ (function () {
|
|
|
898
1990
|
* Update customer
|
|
899
1991
|
*
|
|
900
1992
|
* @remarks
|
|
901
|
-
* This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`,
|
|
902
|
-
*
|
|
903
|
-
* Other fields on a customer are currently immutable.
|
|
1993
|
+
* This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`,
|
|
1994
|
+
* `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and `additional_emails` of an existing customer.
|
|
1995
|
+
* "Other fields on a customer are currently immutable.
|
|
904
1996
|
*/
|
|
905
1997
|
Customer.prototype.updateCustomer = function (req, config) {
|
|
906
1998
|
var _a, _b;
|
|
907
1999
|
return __awaiter(this, void 0, void 0, function () {
|
|
908
|
-
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
|
|
2000
|
+
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
909
2001
|
var _d;
|
|
910
2002
|
return __generator(this, function (_e) {
|
|
911
2003
|
switch (_e.label) {
|
|
@@ -915,21 +2007,32 @@ var Customer = /** @class */ (function () {
|
|
|
915
2007
|
}
|
|
916
2008
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
917
2009
|
url = utils.generateURL(baseURL, "/customers/{customer_id}", req);
|
|
918
|
-
_c = __read([{},
|
|
2010
|
+
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
919
2011
|
try {
|
|
920
|
-
_d = __read(utils.serializeRequestBody(req, "
|
|
2012
|
+
_d = __read(utils.serializeRequestBody(req, "editCustomer", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
921
2013
|
}
|
|
922
2014
|
catch (e) {
|
|
923
2015
|
if (e instanceof Error) {
|
|
924
2016
|
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
925
2017
|
}
|
|
926
2018
|
}
|
|
927
|
-
client = this.sdkConfiguration.
|
|
928
|
-
|
|
2019
|
+
client = this.sdkConfiguration.defaultClient;
|
|
2020
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
2021
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
2022
|
+
return [4 /*yield*/, globalSecurity()];
|
|
2023
|
+
case 1:
|
|
2024
|
+
globalSecurity = _e.sent();
|
|
2025
|
+
_e.label = 2;
|
|
2026
|
+
case 2:
|
|
2027
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
2028
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
2029
|
+
}
|
|
2030
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
2031
|
+
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
929
2032
|
headers["Accept"] = "application/json";
|
|
930
|
-
headers["user-agent"] =
|
|
2033
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
931
2034
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "put", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
932
|
-
case
|
|
2035
|
+
case 3:
|
|
933
2036
|
httpRes = _e.sent();
|
|
934
2037
|
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
935
2038
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
@@ -946,6 +2049,65 @@ var Customer = /** @class */ (function () {
|
|
|
946
2049
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
947
2050
|
res.customer = utils.objectToClass(JSON.parse(decodedRes), shared.Customer);
|
|
948
2051
|
}
|
|
2052
|
+
else {
|
|
2053
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2054
|
+
}
|
|
2055
|
+
break;
|
|
2056
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400:
|
|
2057
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
2058
|
+
res.fourHundredError = JSON.parse(decodedRes);
|
|
2059
|
+
}
|
|
2060
|
+
else {
|
|
2061
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2062
|
+
}
|
|
2063
|
+
break;
|
|
2064
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
2065
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
2066
|
+
res.fourHundredAndOneError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndOneError);
|
|
2067
|
+
}
|
|
2068
|
+
else {
|
|
2069
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2070
|
+
}
|
|
2071
|
+
break;
|
|
2072
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404:
|
|
2073
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
2074
|
+
res.fourHundredAndFourError = JSON.parse(decodedRes);
|
|
2075
|
+
}
|
|
2076
|
+
else {
|
|
2077
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2078
|
+
}
|
|
2079
|
+
break;
|
|
2080
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409:
|
|
2081
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
2082
|
+
res.fourHundredAndNineError = JSON.parse(decodedRes);
|
|
2083
|
+
}
|
|
2084
|
+
else {
|
|
2085
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2086
|
+
}
|
|
2087
|
+
break;
|
|
2088
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413:
|
|
2089
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
2090
|
+
res.fourHundredAndThirteenError = JSON.parse(decodedRes);
|
|
2091
|
+
}
|
|
2092
|
+
else {
|
|
2093
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2094
|
+
}
|
|
2095
|
+
break;
|
|
2096
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
2097
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
2098
|
+
res.fourHundredAndTwentyNineError = utils.objectToClass(JSON.parse(decodedRes), shared.FourHundredAndTwentyNineError);
|
|
2099
|
+
}
|
|
2100
|
+
else {
|
|
2101
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2102
|
+
}
|
|
2103
|
+
break;
|
|
2104
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
2105
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
2106
|
+
res.fiveHundredError = utils.objectToClass(JSON.parse(decodedRes), shared.FiveHundredError);
|
|
2107
|
+
}
|
|
2108
|
+
else {
|
|
2109
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
2110
|
+
}
|
|
949
2111
|
break;
|
|
950
2112
|
}
|
|
951
2113
|
return [2 /*return*/, res];
|