@paygentic/sdk 0.6.29 → 0.6.34
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/FUNCTIONS.md +13 -9
- package/README.md +125 -55
- package/dist/commonjs/funcs/billableMetricsListEvents.d.ts +19 -0
- package/dist/commonjs/funcs/billableMetricsListEvents.d.ts.map +1 -0
- package/dist/commonjs/funcs/billableMetricsListEvents.js +132 -0
- package/dist/commonjs/funcs/billableMetricsListEvents.js.map +1 -0
- package/dist/commonjs/funcs/costsCreateCost.d.ts +19 -0
- package/dist/commonjs/funcs/costsCreateCost.d.ts.map +1 -0
- package/dist/commonjs/funcs/costsCreateCost.js +119 -0
- package/dist/commonjs/funcs/costsCreateCost.js.map +1 -0
- package/dist/commonjs/funcs/costsDeleteCost.d.ts +15 -0
- package/dist/commonjs/funcs/costsDeleteCost.d.ts.map +1 -0
- package/dist/commonjs/funcs/costsDeleteCost.js +121 -0
- package/dist/commonjs/funcs/costsDeleteCost.js.map +1 -0
- package/dist/commonjs/funcs/costsGetCost.d.ts +16 -0
- package/dist/commonjs/funcs/costsGetCost.d.ts.map +1 -0
- package/dist/commonjs/funcs/costsGetCost.js +121 -0
- package/dist/commonjs/funcs/costsGetCost.js.map +1 -0
- package/dist/commonjs/funcs/costsGetCostSummary.d.ts +19 -0
- package/dist/commonjs/funcs/costsGetCostSummary.d.ts.map +1 -0
- package/dist/commonjs/funcs/costsGetCostSummary.js +133 -0
- package/dist/commonjs/funcs/costsGetCostSummary.js.map +1 -0
- package/dist/commonjs/funcs/costsListCosts.d.ts +15 -0
- package/dist/commonjs/funcs/costsListCosts.d.ts.map +1 -0
- package/dist/commonjs/funcs/costsListCosts.js +121 -0
- package/dist/commonjs/funcs/costsListCosts.js.map +1 -0
- package/dist/commonjs/funcs/costsUpdateCost.d.ts +16 -0
- package/dist/commonjs/funcs/costsUpdateCost.d.ts.map +1 -0
- package/dist/commonjs/funcs/costsUpdateCost.js +122 -0
- package/dist/commonjs/funcs/costsUpdateCost.js.map +1 -0
- package/dist/commonjs/funcs/entitlementsGet.js +4 -0
- package/dist/commonjs/funcs/entitlementsGet.js.map +1 -1
- package/dist/commonjs/funcs/entitlementsList.js +1 -0
- package/dist/commonjs/funcs/entitlementsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/encodings.d.ts +1 -0
- package/dist/commonjs/lib/encodings.d.ts.map +1 -1
- package/dist/commonjs/lib/encodings.js +7 -0
- package/dist/commonjs/lib/encodings.js.map +1 -1
- package/dist/commonjs/models/billablemetric.d.ts +4 -4
- package/dist/commonjs/models/billablemetric.d.ts.map +1 -1
- package/dist/commonjs/models/billablemetric.js +4 -5
- package/dist/commonjs/models/billablemetric.js.map +1 -1
- package/dist/commonjs/models/cost.d.ts +67 -0
- package/dist/commonjs/models/cost.d.ts.map +1 -0
- package/dist/commonjs/models/cost.js +89 -0
- package/dist/commonjs/models/cost.js.map +1 -0
- package/dist/commonjs/models/costusageresponse.d.ts +69 -0
- package/dist/commonjs/models/costusageresponse.d.ts.map +1 -0
- package/dist/commonjs/models/costusageresponse.js +91 -0
- package/dist/commonjs/models/costusageresponse.js.map +1 -0
- package/dist/commonjs/models/entitlementaccessresult.d.ts +20 -0
- package/dist/commonjs/models/entitlementaccessresult.d.ts.map +1 -1
- package/dist/commonjs/models/entitlementaccessresult.js +5 -0
- package/dist/commonjs/models/entitlementaccessresult.js.map +1 -1
- package/dist/commonjs/models/grant.d.ts +8 -0
- package/dist/commonjs/models/grant.d.ts.map +1 -1
- package/dist/commonjs/models/grant.js +2 -0
- package/dist/commonjs/models/grant.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +4 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +4 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/invoicelineitem.d.ts +4 -3
- package/dist/commonjs/models/invoicelineitem.d.ts.map +1 -1
- package/dist/commonjs/models/invoicelineitem.js +2 -1
- package/dist/commonjs/models/invoicelineitem.js.map +1 -1
- package/dist/commonjs/models/lineitem.d.ts +4 -3
- package/dist/commonjs/models/lineitem.d.ts.map +1 -1
- package/dist/commonjs/models/lineitem.js +2 -1
- package/dist/commonjs/models/lineitem.js.map +1 -1
- package/dist/commonjs/models/meterevent.d.ts +47 -0
- package/dist/commonjs/models/meterevent.d.ts.map +1 -0
- package/dist/commonjs/models/meterevent.js +62 -0
- package/dist/commonjs/models/meterevent.js.map +1 -0
- package/dist/commonjs/models/metereventlist.d.ts +28 -0
- package/dist/commonjs/models/metereventlist.d.ts.map +1 -0
- package/dist/commonjs/models/metereventlist.js +60 -0
- package/dist/commonjs/models/metereventlist.js.map +1 -0
- package/dist/commonjs/models/operations/createbillablemetric.d.ts +4 -4
- package/dist/commonjs/models/operations/createbillablemetric.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createbillablemetric.js +4 -5
- package/dist/commonjs/models/operations/createbillablemetric.js.map +1 -1
- package/dist/commonjs/models/operations/createcost.d.ts +100 -0
- package/dist/commonjs/models/operations/createcost.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createcost.js +81 -0
- package/dist/commonjs/models/operations/createcost.js.map +1 -0
- package/dist/commonjs/models/operations/createplan.d.ts +36 -2
- package/dist/commonjs/models/operations/createplan.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createplan.js +24 -2
- package/dist/commonjs/models/operations/createplan.js.map +1 -1
- package/dist/commonjs/models/operations/createprice.d.ts +5 -0
- package/dist/commonjs/models/operations/createprice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createprice.js +1 -0
- package/dist/commonjs/models/operations/createprice.js.map +1 -1
- package/dist/commonjs/models/operations/deletecost.d.ts +15 -0
- package/dist/commonjs/models/operations/deletecost.d.ts.map +1 -0
- package/dist/commonjs/models/operations/deletecost.js +49 -0
- package/dist/commonjs/models/operations/deletecost.js.map +1 -0
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts +1 -0
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbillablemetricmeter.js +1 -0
- package/dist/commonjs/models/operations/getbillablemetricmeter.js.map +1 -1
- package/dist/commonjs/models/operations/getcost.d.ts +15 -0
- package/dist/commonjs/models/operations/getcost.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getcost.js +49 -0
- package/dist/commonjs/models/operations/getcost.js.map +1 -0
- package/dist/commonjs/models/operations/getcostsummary.d.ts +60 -0
- package/dist/commonjs/models/operations/getcostsummary.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getcostsummary.js +66 -0
- package/dist/commonjs/models/operations/getcostsummary.js.map +1 -0
- package/dist/commonjs/models/operations/getentitlement.d.ts +5 -0
- package/dist/commonjs/models/operations/getentitlement.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getentitlement.js +1 -0
- package/dist/commonjs/models/operations/getentitlement.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +7 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +7 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listbillablemetricevents.d.ts +37 -0
- package/dist/commonjs/models/operations/listbillablemetricevents.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listbillablemetricevents.js +54 -0
- package/dist/commonjs/models/operations/listbillablemetricevents.js.map +1 -0
- package/dist/commonjs/models/operations/listcosts.d.ts +59 -0
- package/dist/commonjs/models/operations/listcosts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listcosts.js +79 -0
- package/dist/commonjs/models/operations/listcosts.js.map +1 -0
- package/dist/commonjs/models/operations/listentitlements.d.ts +5 -0
- package/dist/commonjs/models/operations/listentitlements.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listentitlements.js +1 -0
- package/dist/commonjs/models/operations/listentitlements.js.map +1 -1
- package/dist/commonjs/models/operations/updatecost.d.ts +88 -0
- package/dist/commonjs/models/operations/updatecost.d.ts.map +1 -0
- package/dist/commonjs/models/operations/updatecost.js +84 -0
- package/dist/commonjs/models/operations/updatecost.js.map +1 -0
- package/dist/commonjs/models/operations/updateplan.d.ts +36 -2
- package/dist/commonjs/models/operations/updateplan.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateplan.js +24 -2
- package/dist/commonjs/models/operations/updateplan.js.map +1 -1
- package/dist/commonjs/models/operations/updateprice.d.ts +5 -0
- package/dist/commonjs/models/operations/updateprice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updateprice.js +1 -0
- package/dist/commonjs/models/operations/updateprice.js.map +1 -1
- package/dist/commonjs/models/plan.d.ts +23 -0
- package/dist/commonjs/models/plan.d.ts.map +1 -1
- package/dist/commonjs/models/plan.js +12 -1
- package/dist/commonjs/models/plan.js.map +1 -1
- package/dist/commonjs/models/price.d.ts +4 -0
- package/dist/commonjs/models/price.d.ts.map +1 -1
- package/dist/commonjs/models/price.js +1 -0
- package/dist/commonjs/models/price.js.map +1 -1
- package/dist/commonjs/models/schemasprice.d.ts +4 -0
- package/dist/commonjs/models/schemasprice.d.ts.map +1 -1
- package/dist/commonjs/models/schemasprice.js +1 -0
- package/dist/commonjs/models/schemasprice.js.map +1 -1
- package/dist/commonjs/models/subscription.d.ts +22 -2
- package/dist/commonjs/models/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/subscription.js +13 -1
- package/dist/commonjs/models/subscription.js.map +1 -1
- package/dist/commonjs/sdk/billablemetrics.d.ts +7 -0
- package/dist/commonjs/sdk/billablemetrics.d.ts.map +1 -1
- package/dist/commonjs/sdk/billablemetrics.js +10 -0
- package/dist/commonjs/sdk/billablemetrics.js.map +1 -1
- package/dist/commonjs/sdk/costs.d.ts +36 -0
- package/dist/commonjs/sdk/costs.d.ts.map +1 -0
- package/dist/commonjs/sdk/costs.js +60 -0
- package/dist/commonjs/sdk/costs.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/billableMetricsListEvents.d.ts +19 -0
- package/dist/esm/funcs/billableMetricsListEvents.d.ts.map +1 -0
- package/dist/esm/funcs/billableMetricsListEvents.js +96 -0
- package/dist/esm/funcs/billableMetricsListEvents.js.map +1 -0
- package/dist/esm/funcs/costsCreateCost.d.ts +19 -0
- package/dist/esm/funcs/costsCreateCost.d.ts.map +1 -0
- package/dist/esm/funcs/costsCreateCost.js +83 -0
- package/dist/esm/funcs/costsCreateCost.js.map +1 -0
- package/dist/esm/funcs/costsDeleteCost.d.ts +15 -0
- package/dist/esm/funcs/costsDeleteCost.d.ts.map +1 -0
- package/dist/esm/funcs/costsDeleteCost.js +85 -0
- package/dist/esm/funcs/costsDeleteCost.js.map +1 -0
- package/dist/esm/funcs/costsGetCost.d.ts +16 -0
- package/dist/esm/funcs/costsGetCost.d.ts.map +1 -0
- package/dist/esm/funcs/costsGetCost.js +85 -0
- package/dist/esm/funcs/costsGetCost.js.map +1 -0
- package/dist/esm/funcs/costsGetCostSummary.d.ts +19 -0
- package/dist/esm/funcs/costsGetCostSummary.d.ts.map +1 -0
- package/dist/esm/funcs/costsGetCostSummary.js +97 -0
- package/dist/esm/funcs/costsGetCostSummary.js.map +1 -0
- package/dist/esm/funcs/costsListCosts.d.ts +15 -0
- package/dist/esm/funcs/costsListCosts.d.ts.map +1 -0
- package/dist/esm/funcs/costsListCosts.js +85 -0
- package/dist/esm/funcs/costsListCosts.js.map +1 -0
- package/dist/esm/funcs/costsUpdateCost.d.ts +16 -0
- package/dist/esm/funcs/costsUpdateCost.d.ts.map +1 -0
- package/dist/esm/funcs/costsUpdateCost.js +86 -0
- package/dist/esm/funcs/costsUpdateCost.js.map +1 -0
- package/dist/esm/funcs/entitlementsGet.js +5 -1
- package/dist/esm/funcs/entitlementsGet.js.map +1 -1
- package/dist/esm/funcs/entitlementsList.js +1 -0
- package/dist/esm/funcs/entitlementsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/encodings.d.ts +1 -0
- package/dist/esm/lib/encodings.d.ts.map +1 -1
- package/dist/esm/lib/encodings.js +6 -0
- package/dist/esm/lib/encodings.js.map +1 -1
- package/dist/esm/models/billablemetric.d.ts +4 -4
- package/dist/esm/models/billablemetric.d.ts.map +1 -1
- package/dist/esm/models/billablemetric.js +3 -4
- package/dist/esm/models/billablemetric.js.map +1 -1
- package/dist/esm/models/cost.d.ts +67 -0
- package/dist/esm/models/cost.d.ts.map +1 -0
- package/dist/esm/models/cost.js +52 -0
- package/dist/esm/models/cost.js.map +1 -0
- package/dist/esm/models/costusageresponse.d.ts +69 -0
- package/dist/esm/models/costusageresponse.d.ts.map +1 -0
- package/dist/esm/models/costusageresponse.js +52 -0
- package/dist/esm/models/costusageresponse.js.map +1 -0
- package/dist/esm/models/entitlementaccessresult.d.ts +20 -0
- package/dist/esm/models/entitlementaccessresult.d.ts.map +1 -1
- package/dist/esm/models/entitlementaccessresult.js +5 -0
- package/dist/esm/models/entitlementaccessresult.js.map +1 -1
- package/dist/esm/models/grant.d.ts +8 -0
- package/dist/esm/models/grant.d.ts.map +1 -1
- package/dist/esm/models/grant.js +2 -0
- package/dist/esm/models/grant.js.map +1 -1
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/invoicelineitem.d.ts +4 -3
- package/dist/esm/models/invoicelineitem.d.ts.map +1 -1
- package/dist/esm/models/invoicelineitem.js +2 -1
- package/dist/esm/models/invoicelineitem.js.map +1 -1
- package/dist/esm/models/lineitem.d.ts +4 -3
- package/dist/esm/models/lineitem.d.ts.map +1 -1
- package/dist/esm/models/lineitem.js +2 -1
- package/dist/esm/models/lineitem.js.map +1 -1
- package/dist/esm/models/meterevent.d.ts +47 -0
- package/dist/esm/models/meterevent.d.ts.map +1 -0
- package/dist/esm/models/meterevent.js +25 -0
- package/dist/esm/models/meterevent.js.map +1 -0
- package/dist/esm/models/metereventlist.d.ts +28 -0
- package/dist/esm/models/metereventlist.d.ts.map +1 -0
- package/dist/esm/models/metereventlist.js +23 -0
- package/dist/esm/models/metereventlist.js.map +1 -0
- package/dist/esm/models/operations/createbillablemetric.d.ts +4 -4
- package/dist/esm/models/operations/createbillablemetric.d.ts.map +1 -1
- package/dist/esm/models/operations/createbillablemetric.js +3 -4
- package/dist/esm/models/operations/createbillablemetric.js.map +1 -1
- package/dist/esm/models/operations/createcost.d.ts +100 -0
- package/dist/esm/models/operations/createcost.d.ts.map +1 -0
- package/dist/esm/models/operations/createcost.js +44 -0
- package/dist/esm/models/operations/createcost.js.map +1 -0
- package/dist/esm/models/operations/createplan.d.ts +36 -2
- package/dist/esm/models/operations/createplan.d.ts.map +1 -1
- package/dist/esm/models/operations/createplan.js +23 -1
- package/dist/esm/models/operations/createplan.js.map +1 -1
- package/dist/esm/models/operations/createprice.d.ts +5 -0
- package/dist/esm/models/operations/createprice.d.ts.map +1 -1
- package/dist/esm/models/operations/createprice.js +1 -0
- package/dist/esm/models/operations/createprice.js.map +1 -1
- package/dist/esm/models/operations/deletecost.d.ts +15 -0
- package/dist/esm/models/operations/deletecost.d.ts.map +1 -0
- package/dist/esm/models/operations/deletecost.js +12 -0
- package/dist/esm/models/operations/deletecost.js.map +1 -0
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts +1 -0
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts.map +1 -1
- package/dist/esm/models/operations/getbillablemetricmeter.js +1 -0
- package/dist/esm/models/operations/getbillablemetricmeter.js.map +1 -1
- package/dist/esm/models/operations/getcost.d.ts +15 -0
- package/dist/esm/models/operations/getcost.d.ts.map +1 -0
- package/dist/esm/models/operations/getcost.js +12 -0
- package/dist/esm/models/operations/getcost.js.map +1 -0
- package/dist/esm/models/operations/getcostsummary.d.ts +60 -0
- package/dist/esm/models/operations/getcostsummary.d.ts.map +1 -0
- package/dist/esm/models/operations/getcostsummary.js +29 -0
- package/dist/esm/models/operations/getcostsummary.js.map +1 -0
- package/dist/esm/models/operations/getentitlement.d.ts +5 -0
- package/dist/esm/models/operations/getentitlement.d.ts.map +1 -1
- package/dist/esm/models/operations/getentitlement.js +1 -0
- package/dist/esm/models/operations/getentitlement.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +7 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +7 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listbillablemetricevents.d.ts +37 -0
- package/dist/esm/models/operations/listbillablemetricevents.d.ts.map +1 -0
- package/dist/esm/models/operations/listbillablemetricevents.js +17 -0
- package/dist/esm/models/operations/listbillablemetricevents.js.map +1 -0
- package/dist/esm/models/operations/listcosts.d.ts +59 -0
- package/dist/esm/models/operations/listcosts.d.ts.map +1 -0
- package/dist/esm/models/operations/listcosts.js +40 -0
- package/dist/esm/models/operations/listcosts.js.map +1 -0
- package/dist/esm/models/operations/listentitlements.d.ts +5 -0
- package/dist/esm/models/operations/listentitlements.d.ts.map +1 -1
- package/dist/esm/models/operations/listentitlements.js +1 -0
- package/dist/esm/models/operations/listentitlements.js.map +1 -1
- package/dist/esm/models/operations/updatecost.d.ts +88 -0
- package/dist/esm/models/operations/updatecost.d.ts.map +1 -0
- package/dist/esm/models/operations/updatecost.js +46 -0
- package/dist/esm/models/operations/updatecost.js.map +1 -0
- package/dist/esm/models/operations/updateplan.d.ts +36 -2
- package/dist/esm/models/operations/updateplan.d.ts.map +1 -1
- package/dist/esm/models/operations/updateplan.js +23 -1
- package/dist/esm/models/operations/updateplan.js.map +1 -1
- package/dist/esm/models/operations/updateprice.d.ts +5 -0
- package/dist/esm/models/operations/updateprice.d.ts.map +1 -1
- package/dist/esm/models/operations/updateprice.js +1 -0
- package/dist/esm/models/operations/updateprice.js.map +1 -1
- package/dist/esm/models/plan.d.ts +23 -0
- package/dist/esm/models/plan.d.ts.map +1 -1
- package/dist/esm/models/plan.js +11 -0
- package/dist/esm/models/plan.js.map +1 -1
- package/dist/esm/models/price.d.ts +4 -0
- package/dist/esm/models/price.d.ts.map +1 -1
- package/dist/esm/models/price.js +1 -0
- package/dist/esm/models/price.js.map +1 -1
- package/dist/esm/models/schemasprice.d.ts +4 -0
- package/dist/esm/models/schemasprice.d.ts.map +1 -1
- package/dist/esm/models/schemasprice.js +1 -0
- package/dist/esm/models/schemasprice.js.map +1 -1
- package/dist/esm/models/subscription.d.ts +22 -2
- package/dist/esm/models/subscription.d.ts.map +1 -1
- package/dist/esm/models/subscription.js +11 -0
- package/dist/esm/models/subscription.js.map +1 -1
- package/dist/esm/sdk/billablemetrics.d.ts +7 -0
- package/dist/esm/sdk/billablemetrics.d.ts.map +1 -1
- package/dist/esm/sdk/billablemetrics.js +10 -0
- package/dist/esm/sdk/billablemetrics.js.map +1 -1
- package/dist/esm/sdk/costs.d.ts +36 -0
- package/dist/esm/sdk/costs.d.ts.map +1 -0
- package/dist/esm/sdk/costs.js +56 -0
- package/dist/esm/sdk/costs.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/examples/customersCreate.example.ts +37 -0
- package/jsr.json +6 -4
- package/package.json +1 -1
- package/src/funcs/billableMetricsListEvents.ts +190 -0
- package/src/funcs/costsCreateCost.ts +175 -0
- package/src/funcs/costsDeleteCost.ts +173 -0
- package/src/funcs/costsGetCost.ts +173 -0
- package/src/funcs/costsGetCostSummary.ts +190 -0
- package/src/funcs/costsListCosts.ts +175 -0
- package/src/funcs/costsUpdateCost.ts +178 -0
- package/src/funcs/entitlementsGet.ts +6 -1
- package/src/funcs/entitlementsList.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +9 -0
- package/src/models/billablemetric.ts +9 -6
- package/src/models/cost.ts +114 -0
- package/src/models/costusageresponse.ts +145 -0
- package/src/models/entitlementaccessresult.ts +29 -0
- package/src/models/grant.ts +10 -0
- package/src/models/index.ts +4 -0
- package/src/models/invoicelineitem.ts +4 -3
- package/src/models/lineitem.ts +4 -3
- package/src/models/meterevent.ts +77 -0
- package/src/models/metereventlist.ts +59 -0
- package/src/models/operations/createbillablemetric.ts +9 -6
- package/src/models/operations/createcost.ts +133 -0
- package/src/models/operations/createplan.ts +50 -3
- package/src/models/operations/createprice.ts +6 -0
- package/src/models/operations/deletecost.ts +34 -0
- package/src/models/operations/getbillablemetricmeter.ts +1 -0
- package/src/models/operations/getcost.ts +30 -0
- package/src/models/operations/getcostsummary.ts +88 -0
- package/src/models/operations/getentitlement.ts +6 -0
- package/src/models/operations/index.ts +7 -0
- package/src/models/operations/listbillablemetricevents.ts +63 -0
- package/src/models/operations/listcosts.ts +124 -0
- package/src/models/operations/listentitlements.ts +6 -0
- package/src/models/operations/updatecost.ts +136 -0
- package/src/models/operations/updateplan.ts +50 -3
- package/src/models/operations/updateprice.ts +6 -0
- package/src/models/plan.ts +28 -0
- package/src/models/price.ts +5 -0
- package/src/models/schemasprice.ts +5 -0
- package/src/models/subscription.ts +46 -2
- package/src/sdk/billablemetrics.ts +18 -0
- package/src/sdk/costs.ts +106 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The cost type. Only `metered` costs are supported; they track usage via events.
|
|
10
|
+
*/
|
|
11
|
+
export const CreateCostType = {
|
|
12
|
+
Metered: "metered",
|
|
13
|
+
} as const;
|
|
14
|
+
/**
|
|
15
|
+
* The cost type. Only `metered` costs are supported; they track usage via events.
|
|
16
|
+
*/
|
|
17
|
+
export type CreateCostType = ClosedEnum<typeof CreateCostType>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Aggregation method for the metered event.
|
|
21
|
+
*/
|
|
22
|
+
export const CreateCostAggregation = {
|
|
23
|
+
Sum: "SUM",
|
|
24
|
+
Count: "COUNT",
|
|
25
|
+
Avg: "AVG",
|
|
26
|
+
Min: "MIN",
|
|
27
|
+
Max: "MAX",
|
|
28
|
+
UniqueCount: "UNIQUE_COUNT",
|
|
29
|
+
Latest: "LATEST",
|
|
30
|
+
} as const;
|
|
31
|
+
/**
|
|
32
|
+
* Aggregation method for the metered event.
|
|
33
|
+
*/
|
|
34
|
+
export type CreateCostAggregation = ClosedEnum<typeof CreateCostAggregation>;
|
|
35
|
+
|
|
36
|
+
export type CreateCostRequest = {
|
|
37
|
+
/**
|
|
38
|
+
* The cost type. Only `metered` costs are supported; they track usage via events.
|
|
39
|
+
*/
|
|
40
|
+
type: CreateCostType;
|
|
41
|
+
/**
|
|
42
|
+
* Human-readable name for the cost.
|
|
43
|
+
*/
|
|
44
|
+
name: string;
|
|
45
|
+
/**
|
|
46
|
+
* Cost per unit, multiplied by measured quantity to compute total cost. Must be non-negative.
|
|
47
|
+
*/
|
|
48
|
+
unitCost: number;
|
|
49
|
+
/**
|
|
50
|
+
* ISO 4217 currency code (e.g. USD, EUR).
|
|
51
|
+
*/
|
|
52
|
+
currency: string;
|
|
53
|
+
/**
|
|
54
|
+
* Unique identifier for a product
|
|
55
|
+
*/
|
|
56
|
+
productId: string;
|
|
57
|
+
/**
|
|
58
|
+
* Unit label for metered costs (e.g. 'token', 'request'). Only valid for metered costs.
|
|
59
|
+
*/
|
|
60
|
+
unit?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Aggregation method for the metered event.
|
|
63
|
+
*/
|
|
64
|
+
aggregation: CreateCostAggregation;
|
|
65
|
+
/**
|
|
66
|
+
* CloudEvents type that identifies the metered event.
|
|
67
|
+
*/
|
|
68
|
+
eventType: string;
|
|
69
|
+
/**
|
|
70
|
+
* JSONPath to extract numeric value from event data. Required for SUM/AVG/MIN/MAX/LATEST aggregations.
|
|
71
|
+
*/
|
|
72
|
+
valueProperty?: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Map of dimension name to JSONPath for group-by queries. Only valid for metered costs.
|
|
75
|
+
*/
|
|
76
|
+
groupBy?: { [k: string]: string } | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Unique identifier for an organization
|
|
79
|
+
*/
|
|
80
|
+
merchantId?: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const CreateCostType$outboundSchema: z.ZodNativeEnum<
|
|
85
|
+
typeof CreateCostType
|
|
86
|
+
> = z.nativeEnum(CreateCostType);
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const CreateCostAggregation$outboundSchema: z.ZodNativeEnum<
|
|
90
|
+
typeof CreateCostAggregation
|
|
91
|
+
> = z.nativeEnum(CreateCostAggregation);
|
|
92
|
+
|
|
93
|
+
/** @internal */
|
|
94
|
+
export type CreateCostRequest$Outbound = {
|
|
95
|
+
type: string;
|
|
96
|
+
name: string;
|
|
97
|
+
unitCost: number;
|
|
98
|
+
currency: string;
|
|
99
|
+
productId: string;
|
|
100
|
+
unit?: string | undefined;
|
|
101
|
+
aggregation: string;
|
|
102
|
+
eventType: string;
|
|
103
|
+
valueProperty?: string | undefined;
|
|
104
|
+
groupBy?: { [k: string]: string } | undefined;
|
|
105
|
+
merchantId?: string | undefined;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export const CreateCostRequest$outboundSchema: z.ZodType<
|
|
110
|
+
CreateCostRequest$Outbound,
|
|
111
|
+
z.ZodTypeDef,
|
|
112
|
+
CreateCostRequest
|
|
113
|
+
> = z.object({
|
|
114
|
+
type: CreateCostType$outboundSchema,
|
|
115
|
+
name: z.string(),
|
|
116
|
+
unitCost: z.number(),
|
|
117
|
+
currency: z.string(),
|
|
118
|
+
productId: z.string(),
|
|
119
|
+
unit: z.string().optional(),
|
|
120
|
+
aggregation: CreateCostAggregation$outboundSchema,
|
|
121
|
+
eventType: z.string(),
|
|
122
|
+
valueProperty: z.string().optional(),
|
|
123
|
+
groupBy: z.record(z.string()).optional(),
|
|
124
|
+
merchantId: z.string().optional(),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export function createCostRequestToJSON(
|
|
128
|
+
createCostRequest: CreateCostRequest,
|
|
129
|
+
): string {
|
|
130
|
+
return JSON.stringify(
|
|
131
|
+
CreateCostRequest$outboundSchema.parse(createCostRequest),
|
|
132
|
+
);
|
|
133
|
+
}
|
|
@@ -5,6 +5,37 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { ClosedEnum } from "../../types/enums.js";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* ISO 8601 duration for the billing period. Takes precedence over billingInterval when both are provided.
|
|
10
|
+
*/
|
|
11
|
+
export const CreatePlanBillingCadence = {
|
|
12
|
+
P1M: "P1M",
|
|
13
|
+
P3M: "P3M",
|
|
14
|
+
P1Y: "P1Y",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* ISO 8601 duration for the billing period. Takes precedence over billingInterval when both are provided.
|
|
18
|
+
*/
|
|
19
|
+
export type CreatePlanBillingCadence = ClosedEnum<
|
|
20
|
+
typeof CreatePlanBillingCadence
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'quarterly' for quarterly billing, 'yearly' for annual billing
|
|
25
|
+
*/
|
|
26
|
+
export const CreatePlanBillingInterval = {
|
|
27
|
+
Monthly: "monthly",
|
|
28
|
+
Quarterly: "quarterly",
|
|
29
|
+
Yearly: "yearly",
|
|
30
|
+
Annual: "annual",
|
|
31
|
+
} as const;
|
|
32
|
+
/**
|
|
33
|
+
* Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'quarterly' for quarterly billing, 'yearly' for annual billing
|
|
34
|
+
*/
|
|
35
|
+
export type CreatePlanBillingInterval = ClosedEnum<
|
|
36
|
+
typeof CreatePlanBillingInterval
|
|
37
|
+
>;
|
|
38
|
+
|
|
8
39
|
/**
|
|
9
40
|
* Whether tax is added on top of the price (exclusive) or included in the price (inclusive)
|
|
10
41
|
*/
|
|
@@ -31,9 +62,13 @@ export type BillingVersion = ClosedEnum<typeof BillingVersion>;
|
|
|
31
62
|
|
|
32
63
|
export type CreatePlanRequest = {
|
|
33
64
|
/**
|
|
34
|
-
*
|
|
65
|
+
* ISO 8601 duration for the billing period. Takes precedence over billingInterval when both are provided.
|
|
35
66
|
*/
|
|
36
|
-
|
|
67
|
+
billingCadence?: CreatePlanBillingCadence | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Recurring billing period frequency. Sample values: 'monthly' for monthly billing, 'quarterly' for quarterly billing, 'yearly' for annual billing
|
|
70
|
+
*/
|
|
71
|
+
billingInterval?: CreatePlanBillingInterval | undefined;
|
|
37
72
|
/**
|
|
38
73
|
* Three-letter ISO 4217 currency code for plan pricing. Must be one of the merchant's supported currencies. Sample values: 'USD' for US dollars, 'EUR' for euros, 'GBP' for British pounds
|
|
39
74
|
*/
|
|
@@ -88,6 +123,16 @@ export type CreatePlanRequest = {
|
|
|
88
123
|
billingVersion?: BillingVersion | undefined;
|
|
89
124
|
};
|
|
90
125
|
|
|
126
|
+
/** @internal */
|
|
127
|
+
export const CreatePlanBillingCadence$outboundSchema: z.ZodNativeEnum<
|
|
128
|
+
typeof CreatePlanBillingCadence
|
|
129
|
+
> = z.nativeEnum(CreatePlanBillingCadence);
|
|
130
|
+
|
|
131
|
+
/** @internal */
|
|
132
|
+
export const CreatePlanBillingInterval$outboundSchema: z.ZodNativeEnum<
|
|
133
|
+
typeof CreatePlanBillingInterval
|
|
134
|
+
> = z.nativeEnum(CreatePlanBillingInterval);
|
|
135
|
+
|
|
91
136
|
/** @internal */
|
|
92
137
|
export const CreatePlanTaxBehavior$outboundSchema: z.ZodNativeEnum<
|
|
93
138
|
typeof CreatePlanTaxBehavior
|
|
@@ -100,6 +145,7 @@ export const BillingVersion$outboundSchema: z.ZodNativeEnum<
|
|
|
100
145
|
|
|
101
146
|
/** @internal */
|
|
102
147
|
export type CreatePlanRequest$Outbound = {
|
|
148
|
+
billingCadence?: string | undefined;
|
|
103
149
|
billingInterval?: string | undefined;
|
|
104
150
|
currency: string;
|
|
105
151
|
defaultTaxCode: string;
|
|
@@ -122,7 +168,8 @@ export const CreatePlanRequest$outboundSchema: z.ZodType<
|
|
|
122
168
|
z.ZodTypeDef,
|
|
123
169
|
CreatePlanRequest
|
|
124
170
|
> = z.object({
|
|
125
|
-
|
|
171
|
+
billingCadence: CreatePlanBillingCadence$outboundSchema.optional(),
|
|
172
|
+
billingInterval: CreatePlanBillingInterval$outboundSchema.optional(),
|
|
126
173
|
currency: z.string(),
|
|
127
174
|
defaultTaxCode: z.string().default("eservice"),
|
|
128
175
|
defaultTaxRate: z.number().default(0),
|
|
@@ -60,6 +60,10 @@ export type CreatePriceRequest = {
|
|
|
60
60
|
billingCadence?: string | null | undefined;
|
|
61
61
|
properties: models.PricePropertiesUnion;
|
|
62
62
|
feature?: models.PriceFeatureInput | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
|
|
65
|
+
*/
|
|
66
|
+
grantDiscountEnabled?: boolean | undefined;
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
/** @internal */
|
|
@@ -82,6 +86,7 @@ export type CreatePriceRequest$Outbound = {
|
|
|
82
86
|
billingCadence?: string | null | undefined;
|
|
83
87
|
properties: models.PricePropertiesUnion$Outbound;
|
|
84
88
|
feature?: models.PriceFeatureInput$Outbound | undefined;
|
|
89
|
+
grantDiscountEnabled: boolean;
|
|
85
90
|
};
|
|
86
91
|
|
|
87
92
|
/** @internal */
|
|
@@ -98,6 +103,7 @@ export const CreatePriceRequest$outboundSchema: z.ZodType<
|
|
|
98
103
|
billingCadence: z.nullable(z.string()).optional(),
|
|
99
104
|
properties: models.PricePropertiesUnion$outboundSchema,
|
|
100
105
|
feature: models.PriceFeatureInput$outboundSchema.optional(),
|
|
106
|
+
grantDiscountEnabled: z.boolean().default(false),
|
|
101
107
|
});
|
|
102
108
|
|
|
103
109
|
export function createPriceRequestToJSON(
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type DeleteCostRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* The unique identifier of the cost
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type DeleteCostRequest$Outbound = {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const DeleteCostRequest$outboundSchema: z.ZodType<
|
|
21
|
+
DeleteCostRequest$Outbound,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
DeleteCostRequest
|
|
24
|
+
> = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function deleteCostRequestToJSON(
|
|
29
|
+
deleteCostRequest: DeleteCostRequest,
|
|
30
|
+
): string {
|
|
31
|
+
return JSON.stringify(
|
|
32
|
+
DeleteCostRequest$outboundSchema.parse(deleteCostRequest),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type GetCostRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* The unique identifier of the cost
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type GetCostRequest$Outbound = {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const GetCostRequest$outboundSchema: z.ZodType<
|
|
21
|
+
GetCostRequest$Outbound,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
GetCostRequest
|
|
24
|
+
> = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function getCostRequestToJSON(getCostRequest: GetCostRequest): string {
|
|
29
|
+
return JSON.stringify(GetCostRequest$outboundSchema.parse(getCostRequest));
|
|
30
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Time window granularity for time-series breakdown.
|
|
10
|
+
*/
|
|
11
|
+
export const Window = {
|
|
12
|
+
Minute: "MINUTE",
|
|
13
|
+
Hour: "HOUR",
|
|
14
|
+
Day: "DAY",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Time window granularity for time-series breakdown.
|
|
18
|
+
*/
|
|
19
|
+
export type Window = ClosedEnum<typeof Window>;
|
|
20
|
+
|
|
21
|
+
export type GetCostSummaryRequest = {
|
|
22
|
+
/**
|
|
23
|
+
* The unique identifier of the cost
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* Filter usage to a specific subject (billing entity). When provided, only cost events matching this subject are included. When omitted, usage is aggregated across all subjects for the merchant.
|
|
28
|
+
*/
|
|
29
|
+
subject?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Start of the query window (ISO 8601). Required together with 'to'.
|
|
32
|
+
*/
|
|
33
|
+
from: Date;
|
|
34
|
+
/**
|
|
35
|
+
* End of the query window (ISO 8601). Required together with 'from'.
|
|
36
|
+
*/
|
|
37
|
+
to: Date;
|
|
38
|
+
/**
|
|
39
|
+
* Comma-separated dimension keys to group results by.
|
|
40
|
+
*/
|
|
41
|
+
groupBy?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Time window granularity for time-series breakdown.
|
|
44
|
+
*/
|
|
45
|
+
window?: Window | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* JSON-encoded dimension filter (e.g. {"model":"gpt-4","region":"us-east"}). Keys must match those defined in the cost's groupBy configuration. Retrieve the cost first to determine valid keys.
|
|
48
|
+
*/
|
|
49
|
+
filterGroupBy?: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const Window$outboundSchema: z.ZodNativeEnum<typeof Window> = z
|
|
54
|
+
.nativeEnum(Window);
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export type GetCostSummaryRequest$Outbound = {
|
|
58
|
+
id: string;
|
|
59
|
+
subject?: string | undefined;
|
|
60
|
+
from: string;
|
|
61
|
+
to: string;
|
|
62
|
+
groupBy?: string | undefined;
|
|
63
|
+
window?: string | undefined;
|
|
64
|
+
filterGroupBy?: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const GetCostSummaryRequest$outboundSchema: z.ZodType<
|
|
69
|
+
GetCostSummaryRequest$Outbound,
|
|
70
|
+
z.ZodTypeDef,
|
|
71
|
+
GetCostSummaryRequest
|
|
72
|
+
> = z.object({
|
|
73
|
+
id: z.string(),
|
|
74
|
+
subject: z.string().optional(),
|
|
75
|
+
from: z.date().transform(v => v.toISOString()),
|
|
76
|
+
to: z.date().transform(v => v.toISOString()),
|
|
77
|
+
groupBy: z.string().optional(),
|
|
78
|
+
window: Window$outboundSchema.optional(),
|
|
79
|
+
filterGroupBy: z.string().optional(),
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export function getCostSummaryRequestToJSON(
|
|
83
|
+
getCostSummaryRequest: GetCostSummaryRequest,
|
|
84
|
+
): string {
|
|
85
|
+
return JSON.stringify(
|
|
86
|
+
GetCostSummaryRequest$outboundSchema.parse(getCostSummaryRequest),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -9,11 +9,16 @@ export type GetEntitlementRequest = {
|
|
|
9
9
|
* The unique identifier of the entitlement.
|
|
10
10
|
*/
|
|
11
11
|
entitlementId: string;
|
|
12
|
+
/**
|
|
13
|
+
* Evaluate balance and access at this point in time (RFC 3339 datetime with any UTC offset, e.g. 2024-01-15T10:30:00Z or 2024-01-15T15:30:00+05:30). Defaults to current time.
|
|
14
|
+
*/
|
|
15
|
+
at?: Date | undefined;
|
|
12
16
|
};
|
|
13
17
|
|
|
14
18
|
/** @internal */
|
|
15
19
|
export type GetEntitlementRequest$Outbound = {
|
|
16
20
|
entitlementId: string;
|
|
21
|
+
at?: string | undefined;
|
|
17
22
|
};
|
|
18
23
|
|
|
19
24
|
/** @internal */
|
|
@@ -23,6 +28,7 @@ export const GetEntitlementRequest$outboundSchema: z.ZodType<
|
|
|
23
28
|
GetEntitlementRequest
|
|
24
29
|
> = z.object({
|
|
25
30
|
entitlementId: z.string(),
|
|
31
|
+
at: z.date().transform(v => v.toISOString()).optional(),
|
|
26
32
|
});
|
|
27
33
|
|
|
28
34
|
export function getEntitlementRequestToJSON(
|
|
@@ -8,6 +8,7 @@ export * from "./batchcreateusageevents.js";
|
|
|
8
8
|
export * from "./bulkapprovesourceevents.js";
|
|
9
9
|
export * from "./bulkrejectsourceevents.js";
|
|
10
10
|
export * from "./createbillablemetric.js";
|
|
11
|
+
export * from "./createcost.js";
|
|
11
12
|
export * from "./createcustomer.js";
|
|
12
13
|
export * from "./createentitlementgrant.js";
|
|
13
14
|
export * from "./createfeature.js";
|
|
@@ -20,6 +21,7 @@ export * from "./createproduct.js";
|
|
|
20
21
|
export * from "./createsource.js";
|
|
21
22
|
export * from "./createsubscription.js";
|
|
22
23
|
export * from "./createtestclock.js";
|
|
24
|
+
export * from "./deletecost.js";
|
|
23
25
|
export * from "./deletecustomer.js";
|
|
24
26
|
export * from "./deletefeature.js";
|
|
25
27
|
export * from "./deletefee.js";
|
|
@@ -30,6 +32,8 @@ export * from "./generateportallink.js";
|
|
|
30
32
|
export * from "./getactiveentitlements.js";
|
|
31
33
|
export * from "./getbillablemetric.js";
|
|
32
34
|
export * from "./getbillablemetricmeter.js";
|
|
35
|
+
export * from "./getcost.js";
|
|
36
|
+
export * from "./getcostsummary.js";
|
|
33
37
|
export * from "./getcustomer.js";
|
|
34
38
|
export * from "./getentitlement.js";
|
|
35
39
|
export * from "./getentitlementgrant.js";
|
|
@@ -51,7 +55,9 @@ export * from "./getusageevent.js";
|
|
|
51
55
|
export * from "./getuser.js";
|
|
52
56
|
export * from "./ingestevent.js";
|
|
53
57
|
export * from "./listavailableplans.js";
|
|
58
|
+
export * from "./listbillablemetricevents.js";
|
|
54
59
|
export * from "./listbillablemetrics.js";
|
|
60
|
+
export * from "./listcosts.js";
|
|
55
61
|
export * from "./listcustomers.js";
|
|
56
62
|
export * from "./listdisputes.js";
|
|
57
63
|
export * from "./listentitlementgrants.js";
|
|
@@ -75,6 +81,7 @@ export * from "./refundusageevent.js";
|
|
|
75
81
|
export * from "./rejectsourceevent.js";
|
|
76
82
|
export * from "./terminatesubscription.js";
|
|
77
83
|
export * from "./updatebillablemetric.js";
|
|
84
|
+
export * from "./updatecost.js";
|
|
78
85
|
export * from "./updatecustomer.js";
|
|
79
86
|
export * from "./updatefeature.js";
|
|
80
87
|
export * from "./updatefee.js";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type ListBillableMetricEventsRequest = {
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Start of query window (ISO 8601)
|
|
11
|
+
*/
|
|
12
|
+
from: Date;
|
|
13
|
+
/**
|
|
14
|
+
* End of query window (ISO 8601)
|
|
15
|
+
*/
|
|
16
|
+
to: Date;
|
|
17
|
+
/**
|
|
18
|
+
* Filter by subject (typically the customer/user ID)
|
|
19
|
+
*/
|
|
20
|
+
subject?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Maximum number of events to return
|
|
23
|
+
*/
|
|
24
|
+
limit?: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Number of events to skip
|
|
27
|
+
*/
|
|
28
|
+
offset?: number | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type ListBillableMetricEventsRequest$Outbound = {
|
|
33
|
+
id: string;
|
|
34
|
+
from: string;
|
|
35
|
+
to: string;
|
|
36
|
+
subject?: string | undefined;
|
|
37
|
+
limit: number;
|
|
38
|
+
offset: number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const ListBillableMetricEventsRequest$outboundSchema: z.ZodType<
|
|
43
|
+
ListBillableMetricEventsRequest$Outbound,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
ListBillableMetricEventsRequest
|
|
46
|
+
> = z.object({
|
|
47
|
+
id: z.string(),
|
|
48
|
+
from: z.date().transform(v => v.toISOString()),
|
|
49
|
+
to: z.date().transform(v => v.toISOString()),
|
|
50
|
+
subject: z.string().optional(),
|
|
51
|
+
limit: z.number().int().default(20),
|
|
52
|
+
offset: z.number().int().default(0),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export function listBillableMetricEventsRequestToJSON(
|
|
56
|
+
listBillableMetricEventsRequest: ListBillableMetricEventsRequest,
|
|
57
|
+
): string {
|
|
58
|
+
return JSON.stringify(
|
|
59
|
+
ListBillableMetricEventsRequest$outboundSchema.parse(
|
|
60
|
+
listBillableMetricEventsRequest,
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
11
|
+
|
|
12
|
+
export type ListCostsRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* Filter costs by merchant organization ID. If omitted, defaults to the merchant associated with the authenticated API key.
|
|
15
|
+
*/
|
|
16
|
+
merchantId?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Filter costs by product ID.
|
|
19
|
+
*/
|
|
20
|
+
productId?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Number of costs to return.
|
|
23
|
+
*/
|
|
24
|
+
limit?: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Number of costs to skip.
|
|
27
|
+
*/
|
|
28
|
+
offset?: number | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const ListCostsObject = {
|
|
32
|
+
List: "list",
|
|
33
|
+
} as const;
|
|
34
|
+
export type ListCostsObject = ClosedEnum<typeof ListCostsObject>;
|
|
35
|
+
|
|
36
|
+
export type ListCostsPagination = {
|
|
37
|
+
limit: number;
|
|
38
|
+
offset: number;
|
|
39
|
+
total: number;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* List of costs
|
|
44
|
+
*/
|
|
45
|
+
export type ListCostsResponse = {
|
|
46
|
+
object: ListCostsObject;
|
|
47
|
+
data: Array<models.Cost>;
|
|
48
|
+
pagination: ListCostsPagination;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type ListCostsRequest$Outbound = {
|
|
53
|
+
merchantId?: string | undefined;
|
|
54
|
+
productId?: string | undefined;
|
|
55
|
+
limit: number;
|
|
56
|
+
offset: number;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const ListCostsRequest$outboundSchema: z.ZodType<
|
|
61
|
+
ListCostsRequest$Outbound,
|
|
62
|
+
z.ZodTypeDef,
|
|
63
|
+
ListCostsRequest
|
|
64
|
+
> = z.object({
|
|
65
|
+
merchantId: z.string().optional(),
|
|
66
|
+
productId: z.string().optional(),
|
|
67
|
+
limit: z.number().int().default(10),
|
|
68
|
+
offset: z.number().int().default(0),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export function listCostsRequestToJSON(
|
|
72
|
+
listCostsRequest: ListCostsRequest,
|
|
73
|
+
): string {
|
|
74
|
+
return JSON.stringify(
|
|
75
|
+
ListCostsRequest$outboundSchema.parse(listCostsRequest),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const ListCostsObject$inboundSchema: z.ZodNativeEnum<
|
|
81
|
+
typeof ListCostsObject
|
|
82
|
+
> = z.nativeEnum(ListCostsObject);
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const ListCostsPagination$inboundSchema: z.ZodType<
|
|
86
|
+
ListCostsPagination,
|
|
87
|
+
z.ZodTypeDef,
|
|
88
|
+
unknown
|
|
89
|
+
> = z.object({
|
|
90
|
+
limit: z.number().int(),
|
|
91
|
+
offset: z.number().int(),
|
|
92
|
+
total: z.number().int(),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export function listCostsPaginationFromJSON(
|
|
96
|
+
jsonString: string,
|
|
97
|
+
): SafeParseResult<ListCostsPagination, SDKValidationError> {
|
|
98
|
+
return safeParse(
|
|
99
|
+
jsonString,
|
|
100
|
+
(x) => ListCostsPagination$inboundSchema.parse(JSON.parse(x)),
|
|
101
|
+
`Failed to parse 'ListCostsPagination' from JSON`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const ListCostsResponse$inboundSchema: z.ZodType<
|
|
107
|
+
ListCostsResponse,
|
|
108
|
+
z.ZodTypeDef,
|
|
109
|
+
unknown
|
|
110
|
+
> = z.object({
|
|
111
|
+
object: ListCostsObject$inboundSchema,
|
|
112
|
+
data: z.array(models.Cost$inboundSchema),
|
|
113
|
+
pagination: z.lazy(() => ListCostsPagination$inboundSchema),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export function listCostsResponseFromJSON(
|
|
117
|
+
jsonString: string,
|
|
118
|
+
): SafeParseResult<ListCostsResponse, SDKValidationError> {
|
|
119
|
+
return safeParse(
|
|
120
|
+
jsonString,
|
|
121
|
+
(x) => ListCostsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
122
|
+
`Failed to parse 'ListCostsResponse' from JSON`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
@@ -34,6 +34,10 @@ export type ListEntitlementsRequest = {
|
|
|
34
34
|
* Number of entitlements to skip. Use with `limit` for pagination through large result sets.
|
|
35
35
|
*/
|
|
36
36
|
offset?: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Evaluate balance and access at this point in time (RFC 3339 datetime with any UTC offset, e.g. 2024-01-15T10:30:00Z or 2024-01-15T15:30:00+05:30). Defaults to current time.
|
|
39
|
+
*/
|
|
40
|
+
at?: Date | undefined;
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export const ListEntitlementsObject = {
|
|
@@ -64,6 +68,7 @@ export type ListEntitlementsRequest$Outbound = {
|
|
|
64
68
|
subscriptionId?: string | undefined;
|
|
65
69
|
limit: number;
|
|
66
70
|
offset: number;
|
|
71
|
+
at?: string | undefined;
|
|
67
72
|
};
|
|
68
73
|
|
|
69
74
|
/** @internal */
|
|
@@ -78,6 +83,7 @@ export const ListEntitlementsRequest$outboundSchema: z.ZodType<
|
|
|
78
83
|
subscriptionId: z.string().optional(),
|
|
79
84
|
limit: z.number().int().default(10),
|
|
80
85
|
offset: z.number().int().default(0),
|
|
86
|
+
at: z.date().transform(v => v.toISOString()).optional(),
|
|
81
87
|
});
|
|
82
88
|
|
|
83
89
|
export function listEntitlementsRequestToJSON(
|