@paygentic/sdk 0.6.29 → 0.6.33
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 +20 -3
- 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/jsr.json +1 -1
- 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,145 @@
|
|
|
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
|
+
|
|
11
|
+
export const CostUsageResponseObject = {
|
|
12
|
+
Cost: "cost",
|
|
13
|
+
} as const;
|
|
14
|
+
export type CostUsageResponseObject = ClosedEnum<
|
|
15
|
+
typeof CostUsageResponseObject
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export const CostUsageResponseType = {
|
|
19
|
+
Metered: "metered",
|
|
20
|
+
} as const;
|
|
21
|
+
export type CostUsageResponseType = ClosedEnum<typeof CostUsageResponseType>;
|
|
22
|
+
|
|
23
|
+
export type Group = {
|
|
24
|
+
dimensions: { [k: string]: string };
|
|
25
|
+
quantity: number;
|
|
26
|
+
cost: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type TimeSery = {
|
|
30
|
+
windowStart: Date;
|
|
31
|
+
windowEnd: Date;
|
|
32
|
+
quantity: number;
|
|
33
|
+
cost: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type CostUsageResponse = {
|
|
37
|
+
object: CostUsageResponseObject;
|
|
38
|
+
/**
|
|
39
|
+
* Unique identifier for a cost
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
type: CostUsageResponseType;
|
|
44
|
+
currency: string;
|
|
45
|
+
/**
|
|
46
|
+
* CloudEvents type for metered costs.
|
|
47
|
+
*/
|
|
48
|
+
eventType?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Total cost for the query window. Null if usage data could not be computed.
|
|
51
|
+
*/
|
|
52
|
+
totalCost: number | null;
|
|
53
|
+
/**
|
|
54
|
+
* Total usage quantity (metered costs only). Null when usage was not computed.
|
|
55
|
+
*/
|
|
56
|
+
totalQuantity?: number | null | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Per-group breakdown (present when groupBy is specified).
|
|
59
|
+
*/
|
|
60
|
+
groups?: Array<Group> | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Time-series breakdown (present when window is specified).
|
|
63
|
+
*/
|
|
64
|
+
timeSeries?: Array<TimeSery> | undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const CostUsageResponseObject$inboundSchema: z.ZodNativeEnum<
|
|
69
|
+
typeof CostUsageResponseObject
|
|
70
|
+
> = z.nativeEnum(CostUsageResponseObject);
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export const CostUsageResponseType$inboundSchema: z.ZodNativeEnum<
|
|
74
|
+
typeof CostUsageResponseType
|
|
75
|
+
> = z.nativeEnum(CostUsageResponseType);
|
|
76
|
+
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const Group$inboundSchema: z.ZodType<Group, z.ZodTypeDef, unknown> = z
|
|
79
|
+
.object({
|
|
80
|
+
dimensions: z.record(z.string()),
|
|
81
|
+
quantity: z.number(),
|
|
82
|
+
cost: z.number(),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export function groupFromJSON(
|
|
86
|
+
jsonString: string,
|
|
87
|
+
): SafeParseResult<Group, SDKValidationError> {
|
|
88
|
+
return safeParse(
|
|
89
|
+
jsonString,
|
|
90
|
+
(x) => Group$inboundSchema.parse(JSON.parse(x)),
|
|
91
|
+
`Failed to parse 'Group' from JSON`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export const TimeSery$inboundSchema: z.ZodType<
|
|
97
|
+
TimeSery,
|
|
98
|
+
z.ZodTypeDef,
|
|
99
|
+
unknown
|
|
100
|
+
> = z.object({
|
|
101
|
+
windowStart: z.string().datetime({ offset: true }).transform(v =>
|
|
102
|
+
new Date(v)
|
|
103
|
+
),
|
|
104
|
+
windowEnd: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
105
|
+
quantity: z.number(),
|
|
106
|
+
cost: z.number(),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
export function timeSeryFromJSON(
|
|
110
|
+
jsonString: string,
|
|
111
|
+
): SafeParseResult<TimeSery, SDKValidationError> {
|
|
112
|
+
return safeParse(
|
|
113
|
+
jsonString,
|
|
114
|
+
(x) => TimeSery$inboundSchema.parse(JSON.parse(x)),
|
|
115
|
+
`Failed to parse 'TimeSery' from JSON`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** @internal */
|
|
120
|
+
export const CostUsageResponse$inboundSchema: z.ZodType<
|
|
121
|
+
CostUsageResponse,
|
|
122
|
+
z.ZodTypeDef,
|
|
123
|
+
unknown
|
|
124
|
+
> = z.object({
|
|
125
|
+
object: CostUsageResponseObject$inboundSchema.default("cost"),
|
|
126
|
+
id: z.string(),
|
|
127
|
+
name: z.string(),
|
|
128
|
+
type: CostUsageResponseType$inboundSchema,
|
|
129
|
+
currency: z.string(),
|
|
130
|
+
eventType: z.string().optional(),
|
|
131
|
+
totalCost: z.nullable(z.number()),
|
|
132
|
+
totalQuantity: z.nullable(z.number()).optional(),
|
|
133
|
+
groups: z.array(z.lazy(() => Group$inboundSchema)).optional(),
|
|
134
|
+
timeSeries: z.array(z.lazy(() => TimeSery$inboundSchema)).optional(),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export function costUsageResponseFromJSON(
|
|
138
|
+
jsonString: string,
|
|
139
|
+
): SafeParseResult<CostUsageResponse, SDKValidationError> {
|
|
140
|
+
return safeParse(
|
|
141
|
+
jsonString,
|
|
142
|
+
(x) => CostUsageResponse$inboundSchema.parse(JSON.parse(x)),
|
|
143
|
+
`Failed to parse 'CostUsageResponse' from JSON`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -76,6 +76,26 @@ export type EntitlementAccessResult = {
|
|
|
76
76
|
* Current status of the entitlement.
|
|
77
77
|
*/
|
|
78
78
|
status: EntitlementAccessResultStatus;
|
|
79
|
+
/**
|
|
80
|
+
* Remaining grant balance. Only present for `metered` features.
|
|
81
|
+
*/
|
|
82
|
+
balance?: number | null | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Total usage in the current period. Only present for `metered` features.
|
|
85
|
+
*/
|
|
86
|
+
usageInPeriod?: number | null | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Amount of overage beyond granted balance. Only present for `metered` features.
|
|
89
|
+
*/
|
|
90
|
+
overage?: number | null | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Start of the current usage period. Only present for `metered` features with a usage period configured.
|
|
93
|
+
*/
|
|
94
|
+
currentPeriodStart?: Date | null | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* End of the current usage period. Only present for `metered` features with a usage period configured.
|
|
97
|
+
*/
|
|
98
|
+
currentPeriodEnd?: Date | null | undefined;
|
|
79
99
|
};
|
|
80
100
|
|
|
81
101
|
/** @internal */
|
|
@@ -105,6 +125,15 @@ export const EntitlementAccessResult$inboundSchema: z.ZodType<
|
|
|
105
125
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
106
126
|
).optional(),
|
|
107
127
|
status: EntitlementAccessResultStatus$inboundSchema,
|
|
128
|
+
balance: z.nullable(z.number()).optional(),
|
|
129
|
+
usageInPeriod: z.nullable(z.number()).optional(),
|
|
130
|
+
overage: z.nullable(z.number()).optional(),
|
|
131
|
+
currentPeriodStart: z.nullable(
|
|
132
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
133
|
+
).optional(),
|
|
134
|
+
currentPeriodEnd: z.nullable(
|
|
135
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
136
|
+
).optional(),
|
|
108
137
|
});
|
|
109
138
|
|
|
110
139
|
export function entitlementAccessResultFromJSON(
|
package/src/models/grant.ts
CHANGED
|
@@ -43,6 +43,14 @@ export type Grant = {
|
|
|
43
43
|
* When the grant was created.
|
|
44
44
|
*/
|
|
45
45
|
createdAt: Date;
|
|
46
|
+
/**
|
|
47
|
+
* The recurrence interval (ISO 8601 duration) if this is a recurring grant. Null for one-time grants.
|
|
48
|
+
*/
|
|
49
|
+
recurrencePeriod: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* The idempotency key used when creating this grant. Null if not provided.
|
|
52
|
+
*/
|
|
53
|
+
idempotencyKey: string | null;
|
|
46
54
|
};
|
|
47
55
|
|
|
48
56
|
/** @internal */
|
|
@@ -68,6 +76,8 @@ export const Grant$inboundSchema: z.ZodType<Grant, z.ZodTypeDef, unknown> = z
|
|
|
68
76
|
createdAt: z.string().datetime({ offset: true }).transform(v =>
|
|
69
77
|
new Date(v)
|
|
70
78
|
),
|
|
79
|
+
recurrencePeriod: z.nullable(z.string()),
|
|
80
|
+
idempotencyKey: z.nullable(z.string()),
|
|
71
81
|
});
|
|
72
82
|
|
|
73
83
|
export function grantFromJSON(
|
package/src/models/index.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from "./address.js";
|
|
|
7
7
|
export * from "./batchusageeventresponse.js";
|
|
8
8
|
export * from "./billablemetric.js";
|
|
9
9
|
export * from "./booleanentitlementdetail.js";
|
|
10
|
+
export * from "./cost.js";
|
|
11
|
+
export * from "./costusageresponse.js";
|
|
10
12
|
export * from "./createdisputerequest.js";
|
|
11
13
|
export * from "./createentitlementrequest.js";
|
|
12
14
|
export * from "./creategrantrequest.js";
|
|
@@ -37,6 +39,8 @@ export * from "./lineitem.js";
|
|
|
37
39
|
export * from "./lineitemsresponse.js";
|
|
38
40
|
export * from "./lineitemssummary.js";
|
|
39
41
|
export * from "./meteredentitlementdetail.js";
|
|
42
|
+
export * from "./meterevent.js";
|
|
43
|
+
export * from "./metereventlist.js";
|
|
40
44
|
export * from "./offsetpagination.js";
|
|
41
45
|
export * from "./payment.js";
|
|
42
46
|
export * from "./paymentsummary.js";
|
|
@@ -9,14 +9,15 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Type of event: 'usage' for billable metric events, 'fee' for fee events
|
|
12
|
+
* Type of event: 'usage' for billable metric events, 'fee' for fee events, 'discount' for grant discount line items (subtotal/total are negative, representing a credit)
|
|
13
13
|
*/
|
|
14
14
|
export const EventType = {
|
|
15
15
|
Usage: "usage",
|
|
16
16
|
Fee: "fee",
|
|
17
|
+
Discount: "discount",
|
|
17
18
|
} as const;
|
|
18
19
|
/**
|
|
19
|
-
* Type of event: 'usage' for billable metric events, 'fee' for fee events
|
|
20
|
+
* Type of event: 'usage' for billable metric events, 'fee' for fee events, 'discount' for grant discount line items (subtotal/total are negative, representing a credit)
|
|
20
21
|
*/
|
|
21
22
|
export type EventType = ClosedEnum<typeof EventType>;
|
|
22
23
|
|
|
@@ -36,7 +37,7 @@ export type InvoiceLineItemLineItemType = ClosedEnum<
|
|
|
36
37
|
|
|
37
38
|
export type InvoiceLineItem = {
|
|
38
39
|
/**
|
|
39
|
-
* Type of event: 'usage' for billable metric events, 'fee' for fee events
|
|
40
|
+
* Type of event: 'usage' for billable metric events, 'fee' for fee events, 'discount' for grant discount line items (subtotal/total are negative, representing a credit)
|
|
40
41
|
*/
|
|
41
42
|
eventType: EventType;
|
|
42
43
|
/**
|
package/src/models/lineitem.ts
CHANGED
|
@@ -9,15 +9,16 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* The type of line item
|
|
12
|
+
* The type of line item. 'discount' line items represent grant discounts with negative subtotal/total amounts.
|
|
13
13
|
*/
|
|
14
14
|
export const LineItemType = {
|
|
15
15
|
Fee: "fee",
|
|
16
16
|
Metered: "metered",
|
|
17
17
|
Manual: "manual",
|
|
18
|
+
Discount: "discount",
|
|
18
19
|
} as const;
|
|
19
20
|
/**
|
|
20
|
-
* The type of line item
|
|
21
|
+
* The type of line item. 'discount' line items represent grant discounts with negative subtotal/total amounts.
|
|
21
22
|
*/
|
|
22
23
|
export type LineItemType = ClosedEnum<typeof LineItemType>;
|
|
23
24
|
|
|
@@ -63,7 +64,7 @@ export type LineItem = {
|
|
|
63
64
|
*/
|
|
64
65
|
invoiceId?: string | null | undefined;
|
|
65
66
|
/**
|
|
66
|
-
* The type of line item
|
|
67
|
+
* The type of line item. 'discount' line items represent grant discounts with negative subtotal/total amounts.
|
|
67
68
|
*/
|
|
68
69
|
type: LineItemType;
|
|
69
70
|
/**
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
|
|
11
|
+
export const MeterEventObject = {
|
|
12
|
+
MeterEvent: "meterEvent",
|
|
13
|
+
} as const;
|
|
14
|
+
export type MeterEventObject = ClosedEnum<typeof MeterEventObject>;
|
|
15
|
+
|
|
16
|
+
export type MeterEvent = {
|
|
17
|
+
/**
|
|
18
|
+
* Unique event identifier
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
object: MeterEventObject;
|
|
22
|
+
/**
|
|
23
|
+
* CloudEvents event type (matches the meter's eventType)
|
|
24
|
+
*/
|
|
25
|
+
type: string;
|
|
26
|
+
/**
|
|
27
|
+
* CloudEvents source that published the event
|
|
28
|
+
*/
|
|
29
|
+
source: string;
|
|
30
|
+
/**
|
|
31
|
+
* Subject of the event — typically the customer ID
|
|
32
|
+
*/
|
|
33
|
+
subject: string;
|
|
34
|
+
/**
|
|
35
|
+
* Time the event occurred
|
|
36
|
+
*/
|
|
37
|
+
time: Date;
|
|
38
|
+
/**
|
|
39
|
+
* Caller-supplied idempotency key
|
|
40
|
+
*/
|
|
41
|
+
idempotencyKey: string;
|
|
42
|
+
/**
|
|
43
|
+
* Event payload
|
|
44
|
+
*/
|
|
45
|
+
data: { [k: string]: any };
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const MeterEventObject$inboundSchema: z.ZodNativeEnum<
|
|
50
|
+
typeof MeterEventObject
|
|
51
|
+
> = z.nativeEnum(MeterEventObject);
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const MeterEvent$inboundSchema: z.ZodType<
|
|
55
|
+
MeterEvent,
|
|
56
|
+
z.ZodTypeDef,
|
|
57
|
+
unknown
|
|
58
|
+
> = z.object({
|
|
59
|
+
id: z.string(),
|
|
60
|
+
object: MeterEventObject$inboundSchema.default("meterEvent"),
|
|
61
|
+
type: z.string(),
|
|
62
|
+
source: z.string(),
|
|
63
|
+
subject: z.string(),
|
|
64
|
+
time: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
65
|
+
idempotencyKey: z.string(),
|
|
66
|
+
data: z.record(z.any()),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export function meterEventFromJSON(
|
|
70
|
+
jsonString: string,
|
|
71
|
+
): SafeParseResult<MeterEvent, SDKValidationError> {
|
|
72
|
+
return safeParse(
|
|
73
|
+
jsonString,
|
|
74
|
+
(x) => MeterEvent$inboundSchema.parse(JSON.parse(x)),
|
|
75
|
+
`Failed to parse 'MeterEvent' from JSON`,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { MeterEvent, MeterEvent$inboundSchema } from "./meterevent.js";
|
|
11
|
+
import {
|
|
12
|
+
OffsetPagination,
|
|
13
|
+
OffsetPagination$inboundSchema,
|
|
14
|
+
} from "./offsetpagination.js";
|
|
15
|
+
|
|
16
|
+
export const MeterEventListObject = {
|
|
17
|
+
List: "list",
|
|
18
|
+
} as const;
|
|
19
|
+
export type MeterEventListObject = ClosedEnum<typeof MeterEventListObject>;
|
|
20
|
+
|
|
21
|
+
export type MeterEventList = {
|
|
22
|
+
object: MeterEventListObject;
|
|
23
|
+
/**
|
|
24
|
+
* Unique identifier for a billable metric
|
|
25
|
+
*/
|
|
26
|
+
billableMetricId: string;
|
|
27
|
+
events: Array<MeterEvent>;
|
|
28
|
+
/**
|
|
29
|
+
* Offset-based pagination response.
|
|
30
|
+
*/
|
|
31
|
+
pagination: OffsetPagination;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const MeterEventListObject$inboundSchema: z.ZodNativeEnum<
|
|
36
|
+
typeof MeterEventListObject
|
|
37
|
+
> = z.nativeEnum(MeterEventListObject);
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const MeterEventList$inboundSchema: z.ZodType<
|
|
41
|
+
MeterEventList,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.object({
|
|
45
|
+
object: MeterEventListObject$inboundSchema.default("list"),
|
|
46
|
+
billableMetricId: z.string(),
|
|
47
|
+
events: z.array(MeterEvent$inboundSchema),
|
|
48
|
+
pagination: OffsetPagination$inboundSchema,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export function meterEventListFromJSON(
|
|
52
|
+
jsonString: string,
|
|
53
|
+
): SafeParseResult<MeterEventList, SDKValidationError> {
|
|
54
|
+
return safeParse(
|
|
55
|
+
jsonString,
|
|
56
|
+
(x) => MeterEventList$inboundSchema.parse(JSON.parse(x)),
|
|
57
|
+
`Failed to parse 'MeterEventList' from JSON`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -8,7 +8,7 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* Aggregation calculation method for metric values.
|
|
10
10
|
*/
|
|
11
|
-
export const
|
|
11
|
+
export const CreateBillableMetricAggregation = {
|
|
12
12
|
Sum: "SUM",
|
|
13
13
|
Count: "COUNT",
|
|
14
14
|
Avg: "AVG",
|
|
@@ -20,13 +20,15 @@ export const Aggregation = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Aggregation calculation method for metric values.
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type CreateBillableMetricAggregation = ClosedEnum<
|
|
24
|
+
typeof CreateBillableMetricAggregation
|
|
25
|
+
>;
|
|
24
26
|
|
|
25
27
|
export type CreateBillableMetricRequest = {
|
|
26
28
|
/**
|
|
27
29
|
* Aggregation calculation method for metric values.
|
|
28
30
|
*/
|
|
29
|
-
aggregation:
|
|
31
|
+
aggregation: CreateBillableMetricAggregation;
|
|
30
32
|
/**
|
|
31
33
|
* Explanatory text describing what the metric tracks and how it's used for billing. Sample values: 'Total tokens consumed by Claude language model interactions', 'Gigabytes of cloud storage utilized', 'Count of machine learning inference requests processed', 'Quantity of AI-generated images created', 'Compute hours spent training neural networks', 'Terabytes of data transferred'
|
|
32
34
|
*/
|
|
@@ -66,8 +68,9 @@ export type CreateBillableMetricRequest = {
|
|
|
66
68
|
};
|
|
67
69
|
|
|
68
70
|
/** @internal */
|
|
69
|
-
export const
|
|
70
|
-
|
|
71
|
+
export const CreateBillableMetricAggregation$outboundSchema: z.ZodNativeEnum<
|
|
72
|
+
typeof CreateBillableMetricAggregation
|
|
73
|
+
> = z.nativeEnum(CreateBillableMetricAggregation);
|
|
71
74
|
|
|
72
75
|
/** @internal */
|
|
73
76
|
export type CreateBillableMetricRequest$Outbound = {
|
|
@@ -89,7 +92,7 @@ export const CreateBillableMetricRequest$outboundSchema: z.ZodType<
|
|
|
89
92
|
z.ZodTypeDef,
|
|
90
93
|
CreateBillableMetricRequest
|
|
91
94
|
> = z.object({
|
|
92
|
-
aggregation:
|
|
95
|
+
aggregation: CreateBillableMetricAggregation$outboundSchema,
|
|
93
96
|
description: z.string(),
|
|
94
97
|
merchantId: z.string(),
|
|
95
98
|
name: z.string(),
|
|
@@ -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),
|