@tirdad/sdk 2.1.42 → 2.1.44
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/esm/funcs/commitments-create-commitment.d.ts +17 -0
- package/esm/funcs/commitments-create-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-create-commitment.js +83 -0
- package/esm/funcs/commitments-create-commitment.js.map +1 -0
- package/esm/funcs/commitments-get-commitment.d.ts +17 -0
- package/esm/funcs/commitments-get-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-get-commitment.js +91 -0
- package/esm/funcs/commitments-get-commitment.js.map +1 -0
- package/esm/funcs/commitments-preview-commitment.d.ts +17 -0
- package/esm/funcs/commitments-preview-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-preview-commitment.js +83 -0
- package/esm/funcs/commitments-preview-commitment.js.map +1 -0
- package/esm/funcs/commitments-query-commitment.d.ts +17 -0
- package/esm/funcs/commitments-query-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-query-commitment.js +83 -0
- package/esm/funcs/commitments-query-commitment.js.map +1 -0
- package/esm/funcs/commitments-terminate-commitment.d.ts +17 -0
- package/esm/funcs/commitments-terminate-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-terminate-commitment.js +93 -0
- package/esm/funcs/commitments-terminate-commitment.js.map +1 -0
- package/esm/funcs/commitments-update-commitment.d.ts +17 -0
- package/esm/funcs/commitments-update-commitment.d.ts.map +1 -0
- package/esm/funcs/commitments-update-commitment.js +93 -0
- package/esm/funcs/commitments-update-commitment.js.map +1 -0
- package/esm/funcs/events-delete-events.d.ts +17 -0
- package/esm/funcs/events-delete-events.d.ts.map +1 -0
- package/esm/funcs/events-delete-events.js +86 -0
- package/esm/funcs/events-delete-events.js.map +1 -0
- package/esm/funcs/self-billing-get-self-billing-summary.d.ts +1 -1
- package/esm/funcs/self-billing-get-self-billing-summary.js +1 -1
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-created.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/sdk/commitments.d.ts +47 -0
- package/esm/sdk/commitments.d.ts.map +1 -0
- package/esm/sdk/commitments.js +68 -0
- package/esm/sdk/commitments.js.map +1 -0
- package/esm/sdk/events.d.ts +7 -0
- package/esm/sdk/events.d.ts.map +1 -1
- package/esm/sdk/events.js +10 -0
- package/esm/sdk/events.js.map +1 -1
- package/esm/sdk/models/active-window.d.ts +20 -0
- package/esm/sdk/models/active-window.d.ts.map +1 -0
- package/esm/sdk/models/active-window.js +24 -0
- package/esm/sdk/models/active-window.js.map +1 -0
- package/esm/sdk/models/add-addon-ref.d.ts +6 -0
- package/esm/sdk/models/add-addon-ref.d.ts.map +1 -1
- package/esm/sdk/models/add-addon-ref.js +3 -0
- package/esm/sdk/models/add-addon-ref.js.map +1 -1
- package/esm/sdk/models/addon-price-override-ref.d.ts +16 -0
- package/esm/sdk/models/addon-price-override-ref.d.ts.map +1 -0
- package/esm/sdk/models/addon-price-override-ref.js +20 -0
- package/esm/sdk/models/addon-price-override-ref.js.map +1 -0
- package/esm/sdk/models/commitment-collection-method.d.ts +12 -0
- package/esm/sdk/models/commitment-collection-method.d.ts.map +1 -0
- package/esm/sdk/models/commitment-collection-method.js +13 -0
- package/esm/sdk/models/commitment-collection-method.js.map +1 -0
- package/esm/sdk/models/commitment-early-termination.d.ts +11 -0
- package/esm/sdk/models/commitment-early-termination.d.ts.map +1 -0
- package/esm/sdk/models/commitment-early-termination.js +12 -0
- package/esm/sdk/models/commitment-early-termination.js.map +1 -0
- package/esm/sdk/models/commitment-filter.d.ts +60 -0
- package/esm/sdk/models/commitment-filter.d.ts.map +1 -0
- package/esm/sdk/models/commitment-filter.js +51 -0
- package/esm/sdk/models/commitment-filter.js.map +1 -0
- package/esm/sdk/models/commitment-measurement.d.ts +12 -0
- package/esm/sdk/models/commitment-measurement.d.ts.map +1 -0
- package/esm/sdk/models/commitment-measurement.js +13 -0
- package/esm/sdk/models/commitment-measurement.js.map +1 -0
- package/esm/sdk/models/commitment-price-input.d.ts +24 -0
- package/esm/sdk/models/commitment-price-input.d.ts.map +1 -0
- package/esm/sdk/models/commitment-price-input.js +27 -0
- package/esm/sdk/models/commitment-price-input.js.map +1 -0
- package/esm/sdk/models/commitment-response.d.ts +56 -0
- package/esm/sdk/models/commitment-response.d.ts.map +1 -0
- package/esm/sdk/models/commitment-response.js +88 -0
- package/esm/sdk/models/commitment-response.js.map +1 -0
- package/esm/sdk/models/commitment-scope-input.d.ts +18 -0
- package/esm/sdk/models/commitment-scope-input.d.ts.map +1 -0
- package/esm/sdk/models/commitment-scope-input.js +20 -0
- package/esm/sdk/models/commitment-scope-input.js.map +1 -0
- package/esm/sdk/models/commitment-scope-type.d.ts +14 -0
- package/esm/sdk/models/commitment-scope-type.d.ts.map +1 -0
- package/esm/sdk/models/commitment-scope-type.js +15 -0
- package/esm/sdk/models/commitment-scope-type.js.map +1 -0
- package/esm/sdk/models/commitment-status.d.ts +13 -0
- package/esm/sdk/models/commitment-status.d.ts.map +1 -0
- package/esm/sdk/models/commitment-status.js +14 -0
- package/esm/sdk/models/commitment-status.js.map +1 -0
- package/esm/sdk/models/commitment-usage-breakdown.d.ts +33 -0
- package/esm/sdk/models/commitment-usage-breakdown.d.ts.map +1 -0
- package/esm/sdk/models/commitment-usage-breakdown.js +37 -0
- package/esm/sdk/models/commitment-usage-breakdown.js.map +1 -0
- package/esm/sdk/models/commitment-usage-value.d.ts +11 -0
- package/esm/sdk/models/commitment-usage-value.d.ts.map +1 -0
- package/esm/sdk/models/commitment-usage-value.js +15 -0
- package/esm/sdk/models/commitment-usage-value.js.map +1 -0
- package/esm/sdk/models/create-commitment-request.d.ts +64 -0
- package/esm/sdk/models/create-commitment-request.d.ts.map +1 -0
- package/esm/sdk/models/create-commitment-request.js +50 -0
- package/esm/sdk/models/create-commitment-request.js.map +1 -0
- package/esm/sdk/models/create-entitlement-request.d.ts +3 -0
- package/esm/sdk/models/create-entitlement-request.d.ts.map +1 -1
- package/esm/sdk/models/create-entitlement-request.js.map +1 -1
- package/esm/sdk/models/create-price-tier.d.ts +3 -0
- package/esm/sdk/models/create-price-tier.d.ts.map +1 -1
- package/esm/sdk/models/create-price-tier.js +3 -0
- package/esm/sdk/models/create-price-tier.js.map +1 -1
- package/esm/sdk/models/create-subscription-request.d.ts +9 -0
- package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
- package/esm/sdk/models/create-subscription-request.js +2 -0
- package/esm/sdk/models/create-subscription-request.js.map +1 -1
- package/esm/sdk/models/delete-events-op.d.ts +14 -0
- package/esm/sdk/models/delete-events-op.d.ts.map +1 -0
- package/esm/sdk/models/delete-events-op.js +21 -0
- package/esm/sdk/models/delete-events-op.js.map +1 -0
- package/esm/sdk/models/delete-events-request.d.ts +38 -0
- package/esm/sdk/models/delete-events-request.d.ts.map +1 -0
- package/esm/sdk/models/delete-events-request.js +27 -0
- package/esm/sdk/models/delete-events-request.js.map +1 -0
- package/esm/sdk/models/delete-events-response.d.ts +11 -0
- package/esm/sdk/models/delete-events-response.d.ts.map +1 -0
- package/esm/sdk/models/delete-events-response.js +21 -0
- package/esm/sdk/models/delete-events-response.js.map +1 -0
- package/esm/sdk/models/get-commitment-op.d.ts +15 -0
- package/esm/sdk/models/get-commitment-op.d.ts.map +1 -0
- package/esm/sdk/models/get-commitment-op.js +12 -0
- package/esm/sdk/models/get-commitment-op.js.map +1 -0
- package/esm/sdk/models/get-usage-by-subscription-response.d.ts +5 -0
- package/esm/sdk/models/get-usage-by-subscription-response.d.ts.map +1 -1
- package/esm/sdk/models/get-usage-by-subscription-response.js +2 -0
- package/esm/sdk/models/get-usage-by-subscription-response.js.map +1 -1
- package/esm/sdk/models/index.d.ts +29 -0
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +29 -0
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/invoice-filter.d.ts +10 -0
- package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
- package/esm/sdk/models/invoice-filter.js +4 -0
- package/esm/sdk/models/invoice-filter.js.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.d.ts +4 -0
- package/esm/sdk/models/invoice-line-item-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.js +2 -0
- package/esm/sdk/models/invoice-line-item-response.js.map +1 -1
- package/esm/sdk/models/invoice-sync-settings.d.ts +2 -0
- package/esm/sdk/models/invoice-sync-settings.d.ts.map +1 -1
- package/esm/sdk/models/invoice-sync-settings.js +3 -0
- package/esm/sdk/models/invoice-sync-settings.js.map +1 -1
- package/esm/sdk/models/list-commitments-response.d.ts +13 -0
- package/esm/sdk/models/list-commitments-response.d.ts.map +1 -0
- package/esm/sdk/models/list-commitments-response.js +17 -0
- package/esm/sdk/models/list-commitments-response.js.map +1 -0
- package/esm/sdk/models/price-price-tier.d.ts +2 -0
- package/esm/sdk/models/price-price-tier.d.ts.map +1 -1
- package/esm/sdk/models/price-price-tier.js +3 -0
- package/esm/sdk/models/price-price-tier.js.map +1 -1
- package/esm/sdk/models/price-transform-quantity.d.ts +5 -0
- package/esm/sdk/models/price-transform-quantity.d.ts.map +1 -1
- package/esm/sdk/models/price-transform-quantity.js +15 -1
- package/esm/sdk/models/price-transform-quantity.js.map +1 -1
- package/esm/sdk/models/report-query-request.d.ts +2 -0
- package/esm/sdk/models/report-query-request.d.ts.map +1 -1
- package/esm/sdk/models/report-query-request.js +1 -0
- package/esm/sdk/models/report-query-request.js.map +1 -1
- package/esm/sdk/models/scheduled-task-entity-type.d.ts +1 -0
- package/esm/sdk/models/scheduled-task-entity-type.d.ts.map +1 -1
- package/esm/sdk/models/scheduled-task-entity-type.js +1 -0
- package/esm/sdk/models/scheduled-task-entity-type.js.map +1 -1
- package/esm/sdk/models/self-billing-charge-response.d.ts +45 -0
- package/esm/sdk/models/self-billing-charge-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-charge-response.js +63 -0
- package/esm/sdk/models/self-billing-charge-response.js.map +1 -0
- package/esm/sdk/models/self-billing-plan-response.d.ts +14 -0
- package/esm/sdk/models/self-billing-plan-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-plan-response.js +18 -0
- package/esm/sdk/models/self-billing-plan-response.js.map +1 -0
- package/esm/sdk/models/self-billing-summary-response.d.ts +2 -0
- package/esm/sdk/models/self-billing-summary-response.d.ts.map +1 -1
- package/esm/sdk/models/self-billing-summary-response.js +2 -0
- package/esm/sdk/models/self-billing-summary-response.js.map +1 -1
- package/esm/sdk/models/subscription-line-item-response.d.ts +5 -0
- package/esm/sdk/models/subscription-line-item-response.d.ts.map +1 -1
- package/esm/sdk/models/subscription-line-item-response.js +4 -0
- package/esm/sdk/models/subscription-line-item-response.js.map +1 -1
- package/esm/sdk/models/subscription-subscription-line-item.d.ts +5 -0
- package/esm/sdk/models/subscription-subscription-line-item.d.ts.map +1 -1
- package/esm/sdk/models/subscription-subscription-line-item.js +4 -0
- package/esm/sdk/models/subscription-subscription-line-item.js.map +1 -1
- package/esm/sdk/models/terminate-commitment-op.d.ts +21 -0
- package/esm/sdk/models/terminate-commitment-op.d.ts.map +1 -0
- package/esm/sdk/models/terminate-commitment-op.js +14 -0
- package/esm/sdk/models/terminate-commitment-op.js.map +1 -0
- package/esm/sdk/models/terminate-commitment-request.d.ts +14 -0
- package/esm/sdk/models/terminate-commitment-request.d.ts.map +1 -0
- package/esm/sdk/models/terminate-commitment-request.js +19 -0
- package/esm/sdk/models/terminate-commitment-request.js.map +1 -0
- package/esm/sdk/models/trigger-force-run-request.d.ts +5 -0
- package/esm/sdk/models/trigger-force-run-request.d.ts.map +1 -1
- package/esm/sdk/models/trigger-force-run-request.js +2 -0
- package/esm/sdk/models/trigger-force-run-request.js.map +1 -1
- package/esm/sdk/models/update-commitment-op.d.ts +21 -0
- package/esm/sdk/models/update-commitment-op.d.ts.map +1 -0
- package/esm/sdk/models/update-commitment-op.js +14 -0
- package/esm/sdk/models/update-commitment-op.js.map +1 -0
- package/esm/sdk/models/update-commitment-request.d.ts +22 -0
- package/esm/sdk/models/update-commitment-request.d.ts.map +1 -0
- package/esm/sdk/models/update-commitment-request.js +21 -0
- package/esm/sdk/models/update-commitment-request.js.map +1 -0
- package/esm/sdk/models/update-entitlement-request.d.ts +3 -0
- package/esm/sdk/models/update-entitlement-request.d.ts.map +1 -1
- package/esm/sdk/models/update-entitlement-request.js.map +1 -1
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.d.ts +13 -0
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.d.ts.map +1 -0
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.js +22 -0
- package/esm/sdk/models/webhook-dto-commitment-webhook-payload.js.map +1 -0
- package/esm/sdk/models/webhook-event-name.d.ts +3 -0
- package/esm/sdk/models/webhook-event-name.d.ts.map +1 -1
- package/esm/sdk/models/webhook-event-name.js +3 -0
- package/esm/sdk/models/webhook-event-name.js.map +1 -1
- package/esm/sdk/models/zoho-pay-pal-payment-method.d.ts +10 -0
- package/esm/sdk/models/zoho-pay-pal-payment-method.d.ts.map +1 -0
- package/esm/sdk/models/zoho-pay-pal-payment-method.js +11 -0
- package/esm/sdk/models/zoho-pay-pal-payment-method.js.map +1 -0
- package/esm/sdk/models/zoho-payment-gateway-settings.d.ts +14 -0
- package/esm/sdk/models/zoho-payment-gateway-settings.d.ts.map +1 -0
- package/esm/sdk/models/zoho-payment-gateway-settings.js +23 -0
- package/esm/sdk/models/zoho-payment-gateway-settings.js.map +1 -0
- package/esm/sdk/models/zoho-payment-gateway.d.ts +15 -0
- package/esm/sdk/models/zoho-payment-gateway.d.ts.map +1 -0
- package/esm/sdk/models/zoho-payment-gateway.js +16 -0
- package/esm/sdk/models/zoho-payment-gateway.js.map +1 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/self-billing.d.ts +1 -1
- package/esm/sdk/self-billing.js +1 -1
- package/esm/sdk/webhook-events.d.ts +21 -0
- package/esm/sdk/webhook-events.d.ts.map +1 -1
- package/esm/sdk/webhook-events.js +30 -0
- package/esm/sdk/webhook-events.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/commitments-create-commitment.ts +172 -0
- package/src/funcs/commitments-get-commitment.ts +181 -0
- package/src/funcs/commitments-preview-commitment.ts +172 -0
- package/src/funcs/commitments-query-commitment.ts +172 -0
- package/src/funcs/commitments-terminate-commitment.ts +187 -0
- package/src/funcs/commitments-update-commitment.ts +187 -0
- package/src/funcs/events-delete-events.ts +175 -0
- package/src/funcs/self-billing-get-self-billing-summary.ts +1 -1
- package/src/funcs/webhook-events-post-webhook-events-commitment-created.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-commitment-terminated.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-commitment-updated.ts +144 -0
- package/src/lib/config.ts +2 -2
- package/src/sdk/commitments.ts +121 -0
- package/src/sdk/events.ts +18 -0
- package/src/sdk/models/active-window.ts +54 -0
- package/src/sdk/models/add-addon-ref.ts +12 -0
- package/src/sdk/models/addon-price-override-ref.ts +45 -0
- package/src/sdk/models/commitment-collection-method.ts +26 -0
- package/src/sdk/models/commitment-early-termination.ts +22 -0
- package/src/sdk/models/commitment-filter.ts +127 -0
- package/src/sdk/models/commitment-measurement.ts +24 -0
- package/src/sdk/models/commitment-price-input.ts +64 -0
- package/src/sdk/models/commitment-response.ts +164 -0
- package/src/sdk/models/commitment-scope-input.ts +49 -0
- package/src/sdk/models/commitment-scope-type.ts +26 -0
- package/src/sdk/models/commitment-status.ts +25 -0
- package/src/sdk/models/commitment-usage-breakdown.ts +86 -0
- package/src/sdk/models/commitment-usage-value.ts +33 -0
- package/src/sdk/models/create-commitment-request.ts +134 -0
- package/src/sdk/models/create-entitlement-request.ts +3 -0
- package/src/sdk/models/create-price-tier.ts +9 -0
- package/src/sdk/models/create-subscription-request.ts +14 -0
- package/src/sdk/models/delete-events-op.ts +45 -0
- package/src/sdk/models/delete-events-request.ts +74 -0
- package/src/sdk/models/delete-events-response.ts +42 -0
- package/src/sdk/models/get-commitment-op.ts +33 -0
- package/src/sdk/models/get-usage-by-subscription-response.ts +11 -0
- package/src/sdk/models/index.ts +29 -0
- package/src/sdk/models/invoice-filter.ts +14 -0
- package/src/sdk/models/invoice-line-item-response.ts +6 -0
- package/src/sdk/models/invoice-sync-settings.ts +7 -0
- package/src/sdk/models/list-commitments-response.ts +41 -0
- package/src/sdk/models/price-price-tier.ts +7 -0
- package/src/sdk/models/price-transform-quantity.ts +33 -1
- package/src/sdk/models/report-query-request.ts +3 -0
- package/src/sdk/models/scheduled-task-entity-type.ts +1 -0
- package/src/sdk/models/self-billing-charge-response.ts +124 -0
- package/src/sdk/models/self-billing-plan-response.ts +41 -0
- package/src/sdk/models/self-billing-summary-response.ts +6 -0
- package/src/sdk/models/subscription-line-item-response.ts +9 -0
- package/src/sdk/models/subscription-subscription-line-item.ts +9 -0
- package/src/sdk/models/terminate-commitment-op.ts +46 -0
- package/src/sdk/models/terminate-commitment-request.ts +44 -0
- package/src/sdk/models/trigger-force-run-request.ts +7 -0
- package/src/sdk/models/update-commitment-op.ts +46 -0
- package/src/sdk/models/update-commitment-request.ts +48 -0
- package/src/sdk/models/update-entitlement-request.ts +3 -0
- package/src/sdk/models/webhook-dto-commitment-webhook-payload.ts +50 -0
- package/src/sdk/models/webhook-event-name.ts +3 -0
- package/src/sdk/models/zoho-pay-pal-payment-method.ts +19 -0
- package/src/sdk/models/zoho-payment-gateway-settings.ts +53 -0
- package/src/sdk/models/zoho-payment-gateway.ts +24 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/self-billing.ts +1 -1
- package/src/sdk/webhook-events.ts +48 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { commitmentsCreateCommitment } from "../funcs/commitments-create-commitment.js";
|
|
6
|
+
import { commitmentsGetCommitment } from "../funcs/commitments-get-commitment.js";
|
|
7
|
+
import { commitmentsPreviewCommitment } from "../funcs/commitments-preview-commitment.js";
|
|
8
|
+
import { commitmentsQueryCommitment } from "../funcs/commitments-query-commitment.js";
|
|
9
|
+
import { commitmentsTerminateCommitment } from "../funcs/commitments-terminate-commitment.js";
|
|
10
|
+
import { commitmentsUpdateCommitment } from "../funcs/commitments-update-commitment.js";
|
|
11
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
13
|
+
import * as models from "./models/index.js";
|
|
14
|
+
|
|
15
|
+
export class Commitments extends ClientSDK {
|
|
16
|
+
/**
|
|
17
|
+
* Create commitment
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Creates a commitment on a subscription: a minimum spend or quantity over a term, with optional committed and overage rates.
|
|
21
|
+
*/
|
|
22
|
+
async createCommitment(
|
|
23
|
+
request: models.CreateCommitmentRequest,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): Promise<models.CommitmentResponse> {
|
|
26
|
+
return unwrapAsync(commitmentsCreateCommitment(
|
|
27
|
+
this,
|
|
28
|
+
request,
|
|
29
|
+
options,
|
|
30
|
+
));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Preview commitment
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Validates a commitment and returns its computed value without creating it.
|
|
38
|
+
*/
|
|
39
|
+
async previewCommitment(
|
|
40
|
+
request: models.CreateCommitmentRequest,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): Promise<models.CommitmentResponse> {
|
|
43
|
+
return unwrapAsync(commitmentsPreviewCommitment(
|
|
44
|
+
this,
|
|
45
|
+
request,
|
|
46
|
+
options,
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Query commitments
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Lists commitments with filtering and sorting. Returns a paginated list.
|
|
55
|
+
*/
|
|
56
|
+
async queryCommitment(
|
|
57
|
+
request: models.CommitmentFilter,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<models.ListCommitmentsResponse> {
|
|
60
|
+
return unwrapAsync(commitmentsQueryCommitment(
|
|
61
|
+
this,
|
|
62
|
+
request,
|
|
63
|
+
options,
|
|
64
|
+
));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get commitment
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* Loads a single commitment by ID.
|
|
72
|
+
*/
|
|
73
|
+
async getCommitment(
|
|
74
|
+
id: string,
|
|
75
|
+
options?: RequestOptions,
|
|
76
|
+
): Promise<models.CommitmentResponse> {
|
|
77
|
+
return unwrapAsync(commitmentsGetCommitment(
|
|
78
|
+
this,
|
|
79
|
+
id,
|
|
80
|
+
options,
|
|
81
|
+
));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Update commitment
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* Updates the descriptive fields of a commitment. Economic terms are immutable.
|
|
89
|
+
*/
|
|
90
|
+
async updateCommitment(
|
|
91
|
+
id: string,
|
|
92
|
+
body: models.UpdateCommitmentRequest,
|
|
93
|
+
options?: RequestOptions,
|
|
94
|
+
): Promise<models.CommitmentResponse> {
|
|
95
|
+
return unwrapAsync(commitmentsUpdateCommitment(
|
|
96
|
+
this,
|
|
97
|
+
id,
|
|
98
|
+
body,
|
|
99
|
+
options,
|
|
100
|
+
));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Terminate commitment
|
|
105
|
+
*
|
|
106
|
+
* @remarks
|
|
107
|
+
* Ends a commitment early, effective at the given time or now.
|
|
108
|
+
*/
|
|
109
|
+
async terminateCommitment(
|
|
110
|
+
id: string,
|
|
111
|
+
body?: models.TerminateCommitmentRequest | undefined,
|
|
112
|
+
options?: RequestOptions,
|
|
113
|
+
): Promise<models.CommitmentResponse> {
|
|
114
|
+
return unwrapAsync(commitmentsTerminateCommitment(
|
|
115
|
+
this,
|
|
116
|
+
id,
|
|
117
|
+
body,
|
|
118
|
+
options,
|
|
119
|
+
));
|
|
120
|
+
}
|
|
121
|
+
}
|
package/src/sdk/events.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { eventsDeleteEvents } from "../funcs/events-delete-events.js";
|
|
5
6
|
import { eventsGetEvent } from "../funcs/events-get-event.js";
|
|
6
7
|
import { eventsGetUsageAnalytics } from "../funcs/events-get-usage-analytics.js";
|
|
7
8
|
import { eventsGetUsageByMeter } from "../funcs/events-get-usage-by-meter.js";
|
|
@@ -65,6 +66,23 @@ export class Events extends ClientSDK {
|
|
|
65
66
|
));
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Delete events
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* Hard-deletes ingested events and the meter usage they produced for the named customers and period, optionally narrowed by feature or by exact event id. Refused when anything in scope has already been invoiced. Irreversible.
|
|
74
|
+
*/
|
|
75
|
+
async deleteEvents(
|
|
76
|
+
request: models.DeleteEventsRequest,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): Promise<models.DeleteEventsResponseResponse> {
|
|
79
|
+
return unwrapAsync(eventsDeleteEvents(
|
|
80
|
+
this,
|
|
81
|
+
request,
|
|
82
|
+
options,
|
|
83
|
+
));
|
|
84
|
+
}
|
|
85
|
+
|
|
68
86
|
/**
|
|
69
87
|
* Get event
|
|
70
88
|
*
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import {
|
|
10
|
+
Bucket,
|
|
11
|
+
Bucket$inboundSchema,
|
|
12
|
+
Bucket$Outbound,
|
|
13
|
+
Bucket$outboundSchema,
|
|
14
|
+
} from "./bucket.js";
|
|
15
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
16
|
+
|
|
17
|
+
export type ActiveWindow = {
|
|
18
|
+
end?: Bucket | undefined;
|
|
19
|
+
start?: Bucket | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const ActiveWindow$inboundSchema: z.ZodMiniType<ActiveWindow, unknown> =
|
|
24
|
+
z.object({
|
|
25
|
+
end: types.optional(Bucket$inboundSchema),
|
|
26
|
+
start: types.optional(Bucket$inboundSchema),
|
|
27
|
+
});
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type ActiveWindow$Outbound = {
|
|
30
|
+
end?: Bucket$Outbound | undefined;
|
|
31
|
+
start?: Bucket$Outbound | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const ActiveWindow$outboundSchema: z.ZodMiniType<
|
|
36
|
+
ActiveWindow$Outbound,
|
|
37
|
+
ActiveWindow
|
|
38
|
+
> = z.object({
|
|
39
|
+
end: z.optional(Bucket$outboundSchema),
|
|
40
|
+
start: z.optional(Bucket$outboundSchema),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function activeWindowToJSON(activeWindow: ActiveWindow): string {
|
|
44
|
+
return JSON.stringify(ActiveWindow$outboundSchema.parse(activeWindow));
|
|
45
|
+
}
|
|
46
|
+
export function activeWindowFromJSON(
|
|
47
|
+
jsonString: string,
|
|
48
|
+
): SafeParseResult<ActiveWindow, SDKValidationError> {
|
|
49
|
+
return safeParse(
|
|
50
|
+
jsonString,
|
|
51
|
+
(x) => ActiveWindow$inboundSchema.parse(JSON.parse(x)),
|
|
52
|
+
`Failed to parse 'ActiveWindow' from JSON`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { AddonCadence, AddonCadence$outboundSchema } from "./addon-cadence.js";
|
|
8
|
+
import {
|
|
9
|
+
AddonPriceOverrideRef,
|
|
10
|
+
AddonPriceOverrideRef$Outbound,
|
|
11
|
+
AddonPriceOverrideRef$outboundSchema,
|
|
12
|
+
} from "./addon-price-override-ref.js";
|
|
8
13
|
import {
|
|
9
14
|
CouponRef,
|
|
10
15
|
CouponRef$Outbound,
|
|
@@ -20,6 +25,10 @@ export type AddAddonRef = {
|
|
|
20
25
|
associationId?: string | undefined;
|
|
21
26
|
cadence?: AddonCadence | undefined;
|
|
22
27
|
coupons?: Array<CouponRef> | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Price overrides minted at execute time; completion repoints the line items instead of minting again.
|
|
30
|
+
*/
|
|
31
|
+
priceOverrides?: Array<AddonPriceOverrideRef> | undefined;
|
|
23
32
|
prorationBehavior?: ProrationBehavior | undefined;
|
|
24
33
|
startDate?: Date | undefined;
|
|
25
34
|
};
|
|
@@ -30,6 +39,7 @@ export type AddAddonRef$Outbound = {
|
|
|
30
39
|
association_id?: string | undefined;
|
|
31
40
|
cadence?: string | undefined;
|
|
32
41
|
coupons?: Array<CouponRef$Outbound> | undefined;
|
|
42
|
+
price_overrides?: Array<AddonPriceOverrideRef$Outbound> | undefined;
|
|
33
43
|
proration_behavior?: string | undefined;
|
|
34
44
|
start_date?: string | undefined;
|
|
35
45
|
};
|
|
@@ -44,6 +54,7 @@ export const AddAddonRef$outboundSchema: z.ZodMiniType<
|
|
|
44
54
|
associationId: z.optional(z.string()),
|
|
45
55
|
cadence: z.optional(AddonCadence$outboundSchema),
|
|
46
56
|
coupons: z.optional(z.array(CouponRef$outboundSchema)),
|
|
57
|
+
priceOverrides: z.optional(z.array(AddonPriceOverrideRef$outboundSchema)),
|
|
47
58
|
prorationBehavior: z.optional(ProrationBehavior$outboundSchema),
|
|
48
59
|
startDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
49
60
|
}),
|
|
@@ -51,6 +62,7 @@ export const AddAddonRef$outboundSchema: z.ZodMiniType<
|
|
|
51
62
|
return remap$(v, {
|
|
52
63
|
addonId: "addon_id",
|
|
53
64
|
associationId: "association_id",
|
|
65
|
+
priceOverrides: "price_overrides",
|
|
54
66
|
prorationBehavior: "proration_behavior",
|
|
55
67
|
startDate: "start_date",
|
|
56
68
|
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type AddonPriceOverrideRef = {
|
|
9
|
+
overridePriceId?: string | undefined;
|
|
10
|
+
priceId?: string | undefined;
|
|
11
|
+
quantity?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type AddonPriceOverrideRef$Outbound = {
|
|
16
|
+
override_price_id?: string | undefined;
|
|
17
|
+
price_id?: string | undefined;
|
|
18
|
+
quantity?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const AddonPriceOverrideRef$outboundSchema: z.ZodMiniType<
|
|
23
|
+
AddonPriceOverrideRef$Outbound,
|
|
24
|
+
AddonPriceOverrideRef
|
|
25
|
+
> = z.pipe(
|
|
26
|
+
z.object({
|
|
27
|
+
overridePriceId: z.optional(z.string()),
|
|
28
|
+
priceId: z.optional(z.string()),
|
|
29
|
+
quantity: z.optional(z.string()),
|
|
30
|
+
}),
|
|
31
|
+
z.transform((v) => {
|
|
32
|
+
return remap$(v, {
|
|
33
|
+
overridePriceId: "override_price_id",
|
|
34
|
+
priceId: "price_id",
|
|
35
|
+
});
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export function addonPriceOverrideRefToJSON(
|
|
40
|
+
addonPriceOverrideRef: AddonPriceOverrideRef,
|
|
41
|
+
): string {
|
|
42
|
+
return JSON.stringify(
|
|
43
|
+
AddonPriceOverrideRef$outboundSchema.parse(addonPriceOverrideRef),
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const CommitmentCollectionMethod = {
|
|
10
|
+
PerPeriod: "per_period",
|
|
11
|
+
BillingTerms: "billing_terms",
|
|
12
|
+
} as const;
|
|
13
|
+
export type CommitmentCollectionMethod = OpenEnum<
|
|
14
|
+
typeof CommitmentCollectionMethod
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const CommitmentCollectionMethod$inboundSchema: z.ZodMiniType<
|
|
19
|
+
CommitmentCollectionMethod,
|
|
20
|
+
unknown
|
|
21
|
+
> = openEnums.inboundSchema(CommitmentCollectionMethod);
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const CommitmentCollectionMethod$outboundSchema: z.ZodMiniType<
|
|
24
|
+
string,
|
|
25
|
+
CommitmentCollectionMethod
|
|
26
|
+
> = openEnums.outboundSchema(CommitmentCollectionMethod);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const CommitmentEarlyTermination = {
|
|
10
|
+
Forfeit: "forfeit",
|
|
11
|
+
CreditNote: "credit_note",
|
|
12
|
+
BillRemaining: "bill_remaining",
|
|
13
|
+
} as const;
|
|
14
|
+
export type CommitmentEarlyTermination = OpenEnum<
|
|
15
|
+
typeof CommitmentEarlyTermination
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const CommitmentEarlyTermination$inboundSchema: z.ZodMiniType<
|
|
20
|
+
CommitmentEarlyTermination,
|
|
21
|
+
unknown
|
|
22
|
+
> = openEnums.inboundSchema(CommitmentEarlyTermination);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import {
|
|
9
|
+
CommitmentScopeType,
|
|
10
|
+
CommitmentScopeType$outboundSchema,
|
|
11
|
+
} from "./commitment-scope-type.js";
|
|
12
|
+
import {
|
|
13
|
+
CommitmentStatus,
|
|
14
|
+
CommitmentStatus$outboundSchema,
|
|
15
|
+
} from "./commitment-status.js";
|
|
16
|
+
import {
|
|
17
|
+
FilterCondition,
|
|
18
|
+
FilterCondition$Outbound,
|
|
19
|
+
FilterCondition$outboundSchema,
|
|
20
|
+
} from "./filter-condition.js";
|
|
21
|
+
import {
|
|
22
|
+
SortCondition,
|
|
23
|
+
SortCondition$Outbound,
|
|
24
|
+
SortCondition$outboundSchema,
|
|
25
|
+
} from "./sort-condition.js";
|
|
26
|
+
import { Status, Status$outboundSchema } from "./status.js";
|
|
27
|
+
|
|
28
|
+
export const CommitmentFilterOrder = {
|
|
29
|
+
Asc: "asc",
|
|
30
|
+
Desc: "desc",
|
|
31
|
+
} as const;
|
|
32
|
+
export type CommitmentFilterOrder = ClosedEnum<typeof CommitmentFilterOrder>;
|
|
33
|
+
|
|
34
|
+
export type CommitmentFilter = {
|
|
35
|
+
/**
|
|
36
|
+
* ActiveFrom/ActiveTo select commitments whose term overlaps [ActiveFrom, ActiveTo).
|
|
37
|
+
*/
|
|
38
|
+
activeFrom?: string | undefined;
|
|
39
|
+
activeTo?: string | undefined;
|
|
40
|
+
customerIds?: Array<string> | undefined;
|
|
41
|
+
endTime?: Date | undefined;
|
|
42
|
+
expand?: string | undefined;
|
|
43
|
+
filters?: Array<FilterCondition> | undefined;
|
|
44
|
+
ids?: Array<string> | undefined;
|
|
45
|
+
limit?: number | undefined;
|
|
46
|
+
offset?: number | undefined;
|
|
47
|
+
order?: CommitmentFilterOrder | undefined;
|
|
48
|
+
scopeEntityIds?: Array<string> | undefined;
|
|
49
|
+
scopeEntityType?: CommitmentScopeType | undefined;
|
|
50
|
+
sort?: Array<SortCondition> | undefined;
|
|
51
|
+
startTime?: Date | undefined;
|
|
52
|
+
status?: Status | undefined;
|
|
53
|
+
statuses?: Array<CommitmentStatus> | undefined;
|
|
54
|
+
subscriptionIds?: Array<string> | undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const CommitmentFilterOrder$outboundSchema: z.ZodMiniEnum<
|
|
59
|
+
typeof CommitmentFilterOrder
|
|
60
|
+
> = z.enum(CommitmentFilterOrder);
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export type CommitmentFilter$Outbound = {
|
|
64
|
+
active_from?: string | undefined;
|
|
65
|
+
active_to?: string | undefined;
|
|
66
|
+
customer_ids?: Array<string> | undefined;
|
|
67
|
+
end_time?: string | undefined;
|
|
68
|
+
expand?: string | undefined;
|
|
69
|
+
filters?: Array<FilterCondition$Outbound> | undefined;
|
|
70
|
+
ids?: Array<string> | undefined;
|
|
71
|
+
limit?: number | undefined;
|
|
72
|
+
offset?: number | undefined;
|
|
73
|
+
order?: string | undefined;
|
|
74
|
+
scope_entity_ids?: Array<string> | undefined;
|
|
75
|
+
scope_entity_type?: string | undefined;
|
|
76
|
+
sort?: Array<SortCondition$Outbound> | undefined;
|
|
77
|
+
start_time?: string | undefined;
|
|
78
|
+
status?: string | undefined;
|
|
79
|
+
statuses?: Array<string> | undefined;
|
|
80
|
+
subscription_ids?: Array<string> | undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const CommitmentFilter$outboundSchema: z.ZodMiniType<
|
|
85
|
+
CommitmentFilter$Outbound,
|
|
86
|
+
CommitmentFilter
|
|
87
|
+
> = z.pipe(
|
|
88
|
+
z.object({
|
|
89
|
+
activeFrom: z.optional(z.string()),
|
|
90
|
+
activeTo: z.optional(z.string()),
|
|
91
|
+
customerIds: z.optional(z.array(z.string())),
|
|
92
|
+
endTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
93
|
+
expand: z.optional(z.string()),
|
|
94
|
+
filters: z.optional(z.array(FilterCondition$outboundSchema)),
|
|
95
|
+
ids: z.optional(z.array(z.string())),
|
|
96
|
+
limit: z.optional(z.int()),
|
|
97
|
+
offset: z.optional(z.int()),
|
|
98
|
+
order: z.optional(CommitmentFilterOrder$outboundSchema),
|
|
99
|
+
scopeEntityIds: z.optional(z.array(z.string())),
|
|
100
|
+
scopeEntityType: z.optional(CommitmentScopeType$outboundSchema),
|
|
101
|
+
sort: z.optional(z.array(SortCondition$outboundSchema)),
|
|
102
|
+
startTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
103
|
+
status: z.optional(Status$outboundSchema),
|
|
104
|
+
statuses: z.optional(z.array(CommitmentStatus$outboundSchema)),
|
|
105
|
+
subscriptionIds: z.optional(z.array(z.string())),
|
|
106
|
+
}),
|
|
107
|
+
z.transform((v) => {
|
|
108
|
+
return remap$(v, {
|
|
109
|
+
activeFrom: "active_from",
|
|
110
|
+
activeTo: "active_to",
|
|
111
|
+
customerIds: "customer_ids",
|
|
112
|
+
endTime: "end_time",
|
|
113
|
+
scopeEntityIds: "scope_entity_ids",
|
|
114
|
+
scopeEntityType: "scope_entity_type",
|
|
115
|
+
startTime: "start_time",
|
|
116
|
+
subscriptionIds: "subscription_ids",
|
|
117
|
+
});
|
|
118
|
+
}),
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
export function commitmentFilterToJSON(
|
|
122
|
+
commitmentFilter: CommitmentFilter,
|
|
123
|
+
): string {
|
|
124
|
+
return JSON.stringify(
|
|
125
|
+
CommitmentFilter$outboundSchema.parse(commitmentFilter),
|
|
126
|
+
);
|
|
127
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const CommitmentMeasurement = {
|
|
10
|
+
BillingPeriod: "billing_period",
|
|
11
|
+
Window: "window",
|
|
12
|
+
} as const;
|
|
13
|
+
export type CommitmentMeasurement = OpenEnum<typeof CommitmentMeasurement>;
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const CommitmentMeasurement$inboundSchema: z.ZodMiniType<
|
|
17
|
+
CommitmentMeasurement,
|
|
18
|
+
unknown
|
|
19
|
+
> = openEnums.inboundSchema(CommitmentMeasurement);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const CommitmentMeasurement$outboundSchema: z.ZodMiniType<
|
|
22
|
+
string,
|
|
23
|
+
CommitmentMeasurement
|
|
24
|
+
> = openEnums.outboundSchema(CommitmentMeasurement);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { BillingModel, BillingModel$outboundSchema } from "./billing-model.js";
|
|
8
|
+
import { BillingTier, BillingTier$outboundSchema } from "./billing-tier.js";
|
|
9
|
+
import {
|
|
10
|
+
CreatePriceTier,
|
|
11
|
+
CreatePriceTier$Outbound,
|
|
12
|
+
CreatePriceTier$outboundSchema,
|
|
13
|
+
} from "./create-price-tier.js";
|
|
14
|
+
import {
|
|
15
|
+
PriceTransformQuantity,
|
|
16
|
+
PriceTransformQuantity$Outbound,
|
|
17
|
+
PriceTransformQuantity$outboundSchema,
|
|
18
|
+
} from "./price-transform-quantity.js";
|
|
19
|
+
|
|
20
|
+
export type CommitmentPriceInput = {
|
|
21
|
+
amount?: string | undefined;
|
|
22
|
+
billingModel?: BillingModel | undefined;
|
|
23
|
+
tierMode?: BillingTier | undefined;
|
|
24
|
+
tiers?: Array<CreatePriceTier> | undefined;
|
|
25
|
+
transformQuantity?: PriceTransformQuantity | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type CommitmentPriceInput$Outbound = {
|
|
30
|
+
amount?: string | undefined;
|
|
31
|
+
billing_model?: string | undefined;
|
|
32
|
+
tier_mode?: string | undefined;
|
|
33
|
+
tiers?: Array<CreatePriceTier$Outbound> | undefined;
|
|
34
|
+
transform_quantity?: PriceTransformQuantity$Outbound | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const CommitmentPriceInput$outboundSchema: z.ZodMiniType<
|
|
39
|
+
CommitmentPriceInput$Outbound,
|
|
40
|
+
CommitmentPriceInput
|
|
41
|
+
> = z.pipe(
|
|
42
|
+
z.object({
|
|
43
|
+
amount: z.optional(z.string()),
|
|
44
|
+
billingModel: z.optional(BillingModel$outboundSchema),
|
|
45
|
+
tierMode: z.optional(BillingTier$outboundSchema),
|
|
46
|
+
tiers: z.optional(z.array(CreatePriceTier$outboundSchema)),
|
|
47
|
+
transformQuantity: z.optional(PriceTransformQuantity$outboundSchema),
|
|
48
|
+
}),
|
|
49
|
+
z.transform((v) => {
|
|
50
|
+
return remap$(v, {
|
|
51
|
+
billingModel: "billing_model",
|
|
52
|
+
tierMode: "tier_mode",
|
|
53
|
+
transformQuantity: "transform_quantity",
|
|
54
|
+
});
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
export function commitmentPriceInputToJSON(
|
|
59
|
+
commitmentPriceInput: CommitmentPriceInput,
|
|
60
|
+
): string {
|
|
61
|
+
return JSON.stringify(
|
|
62
|
+
CommitmentPriceInput$outboundSchema.parse(commitmentPriceInput),
|
|
63
|
+
);
|
|
64
|
+
}
|