@flexprice/sdk 2.1.1 → 2.1.3
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/docs/sdk/models/billing-cadence.md +1 -3
- package/docs/sdk/models/billing-period.md +1 -1
- package/docs/sdk/models/changed-invoice-action.md +19 -0
- package/docs/sdk/models/changed-invoice-status.md +19 -0
- package/docs/sdk/models/changed-invoice.md +30 -0
- package/docs/sdk/models/changed-line-item-action.md +19 -0
- package/docs/sdk/models/changed-line-item.md +20 -0
- package/docs/sdk/models/changed-resources.md +32 -0
- package/docs/sdk/models/changed-subscription-action.md +19 -0
- package/docs/sdk/models/changed-subscription.md +17 -0
- package/docs/sdk/models/clone-environment-request-request.md +19 -0
- package/docs/sdk/models/clone-environment-request.md +17 -0
- package/docs/sdk/models/clone-feature-request-request.md +19 -0
- package/docs/sdk/models/clone-feature-request.md +18 -0
- package/docs/sdk/models/{post-plans-id-clone-request.md → clone-plan-request-request.md} +3 -3
- package/docs/sdk/models/create-price-request.md +7 -9
- package/docs/sdk/models/create-subscription-request.md +40 -41
- package/docs/sdk/models/environment-type.md +15 -0
- package/docs/sdk/models/execute-subscription-change-request.md +2 -2
- package/docs/sdk/models/execute-subscription-modify-request-request.md +21 -0
- package/docs/sdk/models/execute-subscription-modify-request.md +6 -6
- package/docs/sdk/models/invoice-filter.md +1 -0
- package/docs/sdk/models/invoice-response.md +1 -0
- package/docs/sdk/models/line-item-quantity-change.md +20 -0
- package/docs/sdk/models/meter-usage-analytics-request.md +30 -0
- package/docs/sdk/models/meter-usage-analytics-response.md +30 -0
- package/docs/sdk/models/meter-usage-point.md +21 -0
- package/docs/sdk/models/meter-usage-query-request.md +28 -0
- package/docs/sdk/models/meter-usage-query-response.md +30 -0
- package/docs/sdk/models/preview-subscription-change-request.md +2 -2
- package/docs/sdk/models/preview-subscription-modify-request.md +21 -0
- package/docs/sdk/models/secret-provider.md +2 -2
- package/docs/sdk/models/{execute-subscription-inheritance-request.md → sub-modify-inheritance-request.md} +3 -3
- package/docs/sdk/models/sub-modify-quantity-change-request.md +22 -0
- package/docs/sdk/models/subscription-change-request.md +1 -1
- package/docs/sdk/models/subscription-modify-response.md +41 -0
- package/docs/sdk/models/subscription-modify-type.md +15 -0
- package/docs/sdk/models/subscription-phase-create-request.md +9 -8
- package/docs/sdk/models/subscription-price-create-request.md +3 -5
- package/docs/sdks/environments/README.md +79 -0
- package/docs/sdks/features/README.md +73 -0
- package/docs/sdks/invoices/README.md +76 -0
- package/docs/sdks/meterusage/README.md +182 -0
- package/docs/sdks/plans/README.md +7 -7
- package/docs/sdks/prices/README.md +12 -14
- package/docs/sdks/subscriptions/README.md +101 -22
- package/esm/funcs/environments-clone-environment.d.ts +17 -0
- package/esm/funcs/environments-clone-environment.d.ts.map +1 -0
- package/esm/funcs/environments-clone-environment.js +92 -0
- package/esm/funcs/environments-clone-environment.js.map +1 -0
- package/esm/funcs/features-clone-feature.d.ts +17 -0
- package/esm/funcs/features-clone-feature.d.ts.map +1 -0
- package/esm/funcs/features-clone-feature.js +92 -0
- package/esm/funcs/features-clone-feature.js.map +1 -0
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.d.ts +17 -0
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.d.ts.map +1 -0
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.js +82 -0
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.js.map +1 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.d.ts +17 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.d.ts.map +1 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.js +82 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.js.map +1 -0
- package/esm/funcs/meter-usage-query-meter-usage.d.ts +17 -0
- package/esm/funcs/meter-usage-query-meter-usage.d.ts.map +1 -0
- package/esm/funcs/meter-usage-query-meter-usage.js +82 -0
- package/esm/funcs/meter-usage-query-meter-usage.js.map +1 -0
- package/esm/funcs/{plans-post-plans-id-clone.d.ts → plans-clone-plan.d.ts} +2 -2
- package/esm/funcs/plans-clone-plan.d.ts.map +1 -0
- package/esm/funcs/{plans-post-plans-id-clone.js → plans-clone-plan.js} +4 -4
- package/esm/funcs/plans-clone-plan.js.map +1 -0
- package/esm/funcs/subscriptions-execute-subscription-modify.d.ts +3 -3
- package/esm/funcs/subscriptions-execute-subscription-modify.d.ts.map +1 -1
- package/esm/funcs/subscriptions-execute-subscription-modify.js +4 -4
- package/esm/funcs/subscriptions-execute-subscription-modify.js.map +1 -1
- package/esm/funcs/subscriptions-preview-subscription-modify.d.ts +17 -0
- package/esm/funcs/subscriptions-preview-subscription-modify.d.ts.map +1 -0
- package/esm/funcs/subscriptions-preview-subscription-modify.js +92 -0
- package/esm/funcs/subscriptions-preview-subscription-modify.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/lib/encodings.d.ts +1 -0
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +6 -0
- package/esm/lib/encodings.js.map +1 -1
- package/esm/sdk/environments.d.ts +12 -0
- package/esm/sdk/environments.d.ts.map +1 -0
- package/esm/sdk/environments.js +18 -0
- package/esm/sdk/environments.js.map +1 -0
- package/esm/sdk/features.d.ts +7 -0
- package/esm/sdk/features.d.ts.map +1 -1
- package/esm/sdk/features.js +10 -0
- package/esm/sdk/features.js.map +1 -1
- package/esm/sdk/invoices.d.ts +7 -0
- package/esm/sdk/invoices.d.ts.map +1 -1
- package/esm/sdk/invoices.js +10 -0
- package/esm/sdk/invoices.js.map +1 -1
- package/esm/sdk/meter-usage.d.ts +19 -0
- package/esm/sdk/meter-usage.d.ts.map +1 -0
- package/esm/sdk/meter-usage.js +28 -0
- package/esm/sdk/meter-usage.js.map +1 -0
- package/esm/sdk/models/billing-cadence.d.ts +4 -5
- package/esm/sdk/models/billing-cadence.d.ts.map +1 -1
- package/esm/sdk/models/billing-cadence.js +3 -4
- package/esm/sdk/models/billing-cadence.js.map +1 -1
- package/esm/sdk/models/billing-period.d.ts +1 -0
- package/esm/sdk/models/billing-period.d.ts.map +1 -1
- package/esm/sdk/models/billing-period.js +1 -0
- package/esm/sdk/models/billing-period.js.map +1 -1
- package/esm/sdk/models/changed-invoice-action.d.ts +16 -0
- package/esm/sdk/models/changed-invoice-action.d.ts.map +1 -0
- package/esm/sdk/models/changed-invoice-action.js +14 -0
- package/esm/sdk/models/changed-invoice-action.js.map +1 -0
- package/esm/sdk/models/changed-invoice-status.d.ts +16 -0
- package/esm/sdk/models/changed-invoice-status.d.ts.map +1 -0
- package/esm/sdk/models/changed-invoice-status.js +14 -0
- package/esm/sdk/models/changed-invoice-status.js.map +1 -0
- package/esm/sdk/models/changed-invoice.d.ts +24 -0
- package/esm/sdk/models/changed-invoice.d.ts.map +1 -0
- package/esm/sdk/models/changed-invoice.js +27 -0
- package/esm/sdk/models/changed-invoice.js.map +1 -0
- package/esm/sdk/models/changed-line-item-action.d.ts +17 -0
- package/esm/sdk/models/changed-line-item-action.d.ts.map +1 -0
- package/esm/sdk/models/changed-line-item-action.js +15 -0
- package/esm/sdk/models/changed-line-item-action.js.map +1 -0
- package/esm/sdk/models/changed-line-item.d.ts +19 -0
- package/esm/sdk/models/changed-line-item.d.ts.map +1 -0
- package/esm/sdk/models/changed-line-item.js +28 -0
- package/esm/sdk/models/changed-line-item.js.map +1 -0
- package/esm/sdk/models/changed-resources.d.ts +15 -0
- package/esm/sdk/models/changed-resources.d.ts.map +1 -0
- package/esm/sdk/models/changed-resources.js +24 -0
- package/esm/sdk/models/changed-resources.js.map +1 -0
- package/esm/sdk/models/changed-subscription-action.d.ts +16 -0
- package/esm/sdk/models/changed-subscription-action.d.ts.map +1 -0
- package/esm/sdk/models/changed-subscription-action.js +14 -0
- package/esm/sdk/models/changed-subscription-action.js.map +1 -0
- package/esm/sdk/models/changed-subscription.d.ts +17 -0
- package/esm/sdk/models/changed-subscription.d.ts.map +1 -0
- package/esm/sdk/models/changed-subscription.js +18 -0
- package/esm/sdk/models/changed-subscription.js.map +1 -0
- package/esm/sdk/models/clone-environment-op.d.ts +21 -0
- package/esm/sdk/models/clone-environment-op.d.ts.map +1 -0
- package/esm/sdk/models/clone-environment-op.js +14 -0
- package/esm/sdk/models/clone-environment-op.js.map +1 -0
- package/esm/sdk/models/clone-environment-request.d.ts +26 -0
- package/esm/sdk/models/clone-environment-request.d.ts.map +1 -0
- package/esm/sdk/models/clone-environment-request.js +20 -0
- package/esm/sdk/models/clone-environment-request.js.map +1 -0
- package/esm/sdk/models/clone-feature-op.d.ts +21 -0
- package/esm/sdk/models/clone-feature-op.d.ts.map +1 -0
- package/esm/sdk/models/clone-feature-op.js +14 -0
- package/esm/sdk/models/clone-feature-op.js.map +1 -0
- package/esm/sdk/models/clone-feature-request.d.ts +31 -0
- package/esm/sdk/models/clone-feature-request.d.ts.map +1 -0
- package/esm/sdk/models/clone-feature-request.js +20 -0
- package/esm/sdk/models/clone-feature-request.js.map +1 -0
- package/esm/sdk/models/clone-plan-op.d.ts +21 -0
- package/esm/sdk/models/clone-plan-op.d.ts.map +1 -0
- package/esm/sdk/models/{post-plans-id-clone-op.js → clone-plan-op.js} +4 -4
- package/esm/sdk/models/clone-plan-op.js.map +1 -0
- package/esm/sdk/models/create-price-request.d.ts +0 -3
- package/esm/sdk/models/create-price-request.d.ts.map +1 -1
- package/esm/sdk/models/create-price-request.js +0 -3
- package/esm/sdk/models/create-price-request.js.map +1 -1
- package/esm/sdk/models/create-subscription-request.d.ts +10 -3
- package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
- package/esm/sdk/models/create-subscription-request.js +2 -3
- package/esm/sdk/models/create-subscription-request.js.map +1 -1
- package/esm/sdk/models/environment-type.d.ts +10 -0
- package/esm/sdk/models/environment-type.d.ts.map +1 -0
- package/esm/sdk/models/environment-type.js +11 -0
- package/esm/sdk/models/environment-type.js.map +1 -0
- package/esm/sdk/models/execute-subscription-modify-op.d.ts +8 -8
- package/esm/sdk/models/execute-subscription-modify-op.d.ts.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-op.js +5 -5
- package/esm/sdk/models/execute-subscription-modify-op.js.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-request.d.ts +19 -0
- package/esm/sdk/models/execute-subscription-modify-request.d.ts.map +1 -0
- package/esm/sdk/models/execute-subscription-modify-request.js +23 -0
- package/esm/sdk/models/execute-subscription-modify-request.js.map +1 -0
- package/esm/sdk/models/index.d.ts +26 -2
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +26 -2
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/invoice-filter.d.ts +5 -0
- package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
- package/esm/sdk/models/invoice-filter.js +2 -0
- package/esm/sdk/models/invoice-filter.js.map +1 -1
- package/esm/sdk/models/invoice-response.d.ts +7 -0
- package/esm/sdk/models/invoice-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-response.js +2 -0
- package/esm/sdk/models/invoice-response.js.map +1 -1
- package/esm/sdk/models/line-item-quantity-change.d.ts +22 -0
- package/esm/sdk/models/line-item-quantity-change.d.ts.map +1 -0
- package/esm/sdk/models/line-item-quantity-change.js +19 -0
- package/esm/sdk/models/line-item-quantity-change.js.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-request.d.ts +26 -0
- package/esm/sdk/models/meter-usage-analytics-request.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-request.js +31 -0
- package/esm/sdk/models/meter-usage-analytics-request.js.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-response.d.ts +11 -0
- package/esm/sdk/models/meter-usage-analytics-response.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-response.js +15 -0
- package/esm/sdk/models/meter-usage-analytics-response.js.map +1 -0
- package/esm/sdk/models/meter-usage-point.d.ts +12 -0
- package/esm/sdk/models/meter-usage-point.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-point.js +21 -0
- package/esm/sdk/models/meter-usage-point.js.map +1 -0
- package/esm/sdk/models/meter-usage-query-request.d.ts +26 -0
- package/esm/sdk/models/meter-usage-query-request.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-query-request.js +31 -0
- package/esm/sdk/models/meter-usage-query-request.js.map +1 -0
- package/esm/sdk/models/meter-usage-query-response.d.ts +16 -0
- package/esm/sdk/models/meter-usage-query-response.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-query-response.js +28 -0
- package/esm/sdk/models/meter-usage-query-response.js.map +1 -0
- package/esm/sdk/models/preview-subscription-modify-op.d.ts +21 -0
- package/esm/sdk/models/preview-subscription-modify-op.d.ts.map +1 -0
- package/esm/sdk/models/preview-subscription-modify-op.js +14 -0
- package/esm/sdk/models/preview-subscription-modify-op.js.map +1 -0
- package/esm/sdk/models/secret-provider.d.ts +1 -0
- package/esm/sdk/models/secret-provider.d.ts.map +1 -1
- package/esm/sdk/models/secret-provider.js +1 -0
- package/esm/sdk/models/secret-provider.js.map +1 -1
- package/esm/sdk/models/sub-modify-inheritance-request.d.ts +12 -0
- package/esm/sdk/models/sub-modify-inheritance-request.d.ts.map +1 -0
- package/esm/sdk/models/{execute-subscription-inheritance-request.js → sub-modify-inheritance-request.js} +4 -4
- package/esm/sdk/models/sub-modify-inheritance-request.js.map +1 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.d.ts +13 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.d.ts.map +1 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.js +18 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.js.map +1 -0
- package/esm/sdk/models/subscription-modify-response.d.ts +13 -0
- package/esm/sdk/models/subscription-modify-response.d.ts.map +1 -0
- package/esm/sdk/models/subscription-modify-response.js +22 -0
- package/esm/sdk/models/subscription-modify-response.js.map +1 -0
- package/esm/sdk/models/subscription-modify-type.d.ts +10 -0
- package/esm/sdk/models/subscription-modify-type.d.ts.map +1 -0
- package/esm/sdk/models/subscription-modify-type.js +11 -0
- package/esm/sdk/models/subscription-modify-type.js.map +1 -0
- package/esm/sdk/models/subscription-phase-create-request.d.ts +9 -0
- package/esm/sdk/models/subscription-phase-create-request.d.ts.map +1 -1
- package/esm/sdk/models/subscription-phase-create-request.js +3 -0
- package/esm/sdk/models/subscription-phase-create-request.js.map +1 -1
- package/esm/sdk/models/subscription-price-create-request.d.ts +0 -3
- package/esm/sdk/models/subscription-price-create-request.d.ts.map +1 -1
- package/esm/sdk/models/subscription-price-create-request.js +0 -3
- package/esm/sdk/models/subscription-price-create-request.js.map +1 -1
- package/esm/sdk/plans.d.ts +1 -1
- package/esm/sdk/plans.d.ts.map +1 -1
- package/esm/sdk/plans.js +3 -3
- package/esm/sdk/plans.js.map +1 -1
- package/esm/sdk/sdk.d.ts +6 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +10 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/subscriptions.d.ts +10 -3
- package/esm/sdk/subscriptions.d.ts.map +1 -1
- package/esm/sdk/subscriptions.js +12 -2
- package/esm/sdk/subscriptions.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/environments-clone-environment.ts +185 -0
- package/src/funcs/features-clone-feature.ts +184 -0
- package/src/funcs/invoices-get-meter-usage-preview-invoice.ts +170 -0
- package/src/funcs/meter-usage-get-meter-usage-analytics.ts +170 -0
- package/src/funcs/meter-usage-query-meter-usage.ts +170 -0
- package/src/funcs/{plans-post-plans-id-clone.ts → plans-clone-plan.ts} +4 -4
- package/src/funcs/subscriptions-execute-subscription-modify.ts +13 -10
- package/src/funcs/subscriptions-preview-subscription-modify.ts +185 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +9 -0
- package/src/sdk/environments.ts +29 -0
- package/src/sdk/features.ts +20 -0
- package/src/sdk/invoices.ts +18 -0
- package/src/sdk/meter-usage.ts +45 -0
- package/src/sdk/models/billing-cadence.ts +8 -12
- package/src/sdk/models/billing-period.ts +1 -0
- package/src/sdk/models/changed-invoice-action.ts +25 -0
- package/src/sdk/models/changed-invoice-status.ts +25 -0
- package/src/sdk/models/changed-invoice.ts +69 -0
- package/src/sdk/models/changed-line-item-action.ts +26 -0
- package/src/sdk/models/changed-line-item.ts +59 -0
- package/src/sdk/models/changed-resources.ts +55 -0
- package/src/sdk/models/changed-subscription-action.ts +27 -0
- package/src/sdk/models/changed-subscription.ts +46 -0
- package/src/sdk/models/clone-environment-op.ts +46 -0
- package/src/sdk/models/clone-environment-request.ts +57 -0
- package/src/sdk/models/clone-feature-op.ts +44 -0
- package/src/sdk/models/clone-feature-request.ts +56 -0
- package/src/sdk/models/{post-plans-id-clone-op.ts → clone-plan-op.ts} +8 -8
- package/src/sdk/models/create-price-request.ts +0 -8
- package/src/sdk/models/create-subscription-request.ts +14 -8
- package/src/sdk/models/environment-type.ts +17 -0
- package/src/sdk/models/execute-subscription-modify-op.ts +22 -20
- package/src/sdk/models/execute-subscription-modify-request.ts +63 -0
- package/src/sdk/models/index.ts +26 -2
- package/src/sdk/models/invoice-filter.ts +7 -0
- package/src/sdk/models/invoice-response.ts +9 -0
- package/src/sdk/models/line-item-quantity-change.ts +52 -0
- package/src/sdk/models/meter-usage-analytics-request.ts +69 -0
- package/src/sdk/models/meter-usage-analytics-response.ts +35 -0
- package/src/sdk/models/meter-usage-point.ts +43 -0
- package/src/sdk/models/meter-usage-query-request.ts +69 -0
- package/src/sdk/models/meter-usage-query-response.ts +58 -0
- package/src/sdk/models/preview-subscription-modify-op.ts +46 -0
- package/src/sdk/models/secret-provider.ts +1 -0
- package/src/sdk/models/sub-modify-inheritance-request.ts +41 -0
- package/src/sdk/models/sub-modify-quantity-change-request.ts +45 -0
- package/src/sdk/models/subscription-modify-response.ts +49 -0
- package/src/sdk/models/subscription-modify-type.ts +17 -0
- package/src/sdk/models/subscription-phase-create-request.ts +17 -0
- package/src/sdk/models/subscription-price-create-request.ts +0 -8
- package/src/sdk/plans.ts +3 -3
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/subscriptions.ts +24 -4
- package/esm/funcs/plans-post-plans-id-clone.d.ts.map +0 -1
- package/esm/funcs/plans-post-plans-id-clone.js.map +0 -1
- package/esm/sdk/models/execute-subscription-inheritance-request.d.ts +0 -12
- package/esm/sdk/models/execute-subscription-inheritance-request.d.ts.map +0 -1
- package/esm/sdk/models/execute-subscription-inheritance-request.js.map +0 -1
- package/esm/sdk/models/post-plans-id-clone-op.d.ts +0 -21
- package/esm/sdk/models/post-plans-id-clone-op.d.ts.map +0 -1
- package/esm/sdk/models/post-plans-id-clone-op.js.map +0 -1
- package/src/sdk/models/execute-subscription-inheritance-request.ts +0 -42
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const EnvironmentType = {
|
|
9
|
+
Development: "development",
|
|
10
|
+
Production: "production",
|
|
11
|
+
} as const;
|
|
12
|
+
export type EnvironmentType = ClosedEnum<typeof EnvironmentType>;
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const EnvironmentType$outboundSchema: z.ZodMiniEnum<
|
|
16
|
+
typeof EnvironmentType
|
|
17
|
+
> = z.enum(EnvironmentType);
|
|
@@ -4,43 +4,45 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "./execute-subscription-
|
|
7
|
+
ExecuteSubscriptionModifyRequest,
|
|
8
|
+
ExecuteSubscriptionModifyRequest$Outbound,
|
|
9
|
+
ExecuteSubscriptionModifyRequest$outboundSchema,
|
|
10
|
+
} from "./execute-subscription-modify-request.js";
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type ExecuteSubscriptionModifyRequestRequest = {
|
|
13
13
|
/**
|
|
14
14
|
* Subscription ID
|
|
15
15
|
*/
|
|
16
16
|
id: string;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Modification request
|
|
19
19
|
*/
|
|
20
|
-
body:
|
|
20
|
+
body: ExecuteSubscriptionModifyRequest;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/** @internal */
|
|
24
|
-
export type
|
|
24
|
+
export type ExecuteSubscriptionModifyRequestRequest$Outbound = {
|
|
25
25
|
id: string;
|
|
26
|
-
body:
|
|
26
|
+
body: ExecuteSubscriptionModifyRequest$Outbound;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
/** @internal */
|
|
30
|
-
export const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
export const ExecuteSubscriptionModifyRequestRequest$outboundSchema:
|
|
31
|
+
z.ZodMiniType<
|
|
32
|
+
ExecuteSubscriptionModifyRequestRequest$Outbound,
|
|
33
|
+
ExecuteSubscriptionModifyRequestRequest
|
|
34
|
+
> = z.object({
|
|
35
|
+
id: z.string(),
|
|
36
|
+
body: ExecuteSubscriptionModifyRequest$outboundSchema,
|
|
37
|
+
});
|
|
37
38
|
|
|
38
|
-
export function
|
|
39
|
-
|
|
39
|
+
export function executeSubscriptionModifyRequestRequestToJSON(
|
|
40
|
+
executeSubscriptionModifyRequestRequest:
|
|
41
|
+
ExecuteSubscriptionModifyRequestRequest,
|
|
40
42
|
): string {
|
|
41
43
|
return JSON.stringify(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
ExecuteSubscriptionModifyRequestRequest$outboundSchema.parse(
|
|
45
|
+
executeSubscriptionModifyRequestRequest,
|
|
44
46
|
),
|
|
45
47
|
);
|
|
46
48
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 {
|
|
8
|
+
SubModifyInheritanceRequest,
|
|
9
|
+
SubModifyInheritanceRequest$Outbound,
|
|
10
|
+
SubModifyInheritanceRequest$outboundSchema,
|
|
11
|
+
} from "./sub-modify-inheritance-request.js";
|
|
12
|
+
import {
|
|
13
|
+
SubModifyQuantityChangeRequest,
|
|
14
|
+
SubModifyQuantityChangeRequest$Outbound,
|
|
15
|
+
SubModifyQuantityChangeRequest$outboundSchema,
|
|
16
|
+
} from "./sub-modify-quantity-change-request.js";
|
|
17
|
+
import {
|
|
18
|
+
SubscriptionModifyType,
|
|
19
|
+
SubscriptionModifyType$outboundSchema,
|
|
20
|
+
} from "./subscription-modify-type.js";
|
|
21
|
+
|
|
22
|
+
export type ExecuteSubscriptionModifyRequest = {
|
|
23
|
+
inheritanceParams?: SubModifyInheritanceRequest | undefined;
|
|
24
|
+
quantityChangeParams?: SubModifyQuantityChangeRequest | undefined;
|
|
25
|
+
type: SubscriptionModifyType;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type ExecuteSubscriptionModifyRequest$Outbound = {
|
|
30
|
+
inheritance_params?: SubModifyInheritanceRequest$Outbound | undefined;
|
|
31
|
+
quantity_change_params?: SubModifyQuantityChangeRequest$Outbound | undefined;
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const ExecuteSubscriptionModifyRequest$outboundSchema: z.ZodMiniType<
|
|
37
|
+
ExecuteSubscriptionModifyRequest$Outbound,
|
|
38
|
+
ExecuteSubscriptionModifyRequest
|
|
39
|
+
> = z.pipe(
|
|
40
|
+
z.object({
|
|
41
|
+
inheritanceParams: z.optional(SubModifyInheritanceRequest$outboundSchema),
|
|
42
|
+
quantityChangeParams: z.optional(
|
|
43
|
+
SubModifyQuantityChangeRequest$outboundSchema,
|
|
44
|
+
),
|
|
45
|
+
type: SubscriptionModifyType$outboundSchema,
|
|
46
|
+
}),
|
|
47
|
+
z.transform((v) => {
|
|
48
|
+
return remap$(v, {
|
|
49
|
+
inheritanceParams: "inheritance_params",
|
|
50
|
+
quantityChangeParams: "quantity_change_params",
|
|
51
|
+
});
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export function executeSubscriptionModifyRequestToJSON(
|
|
56
|
+
executeSubscriptionModifyRequest: ExecuteSubscriptionModifyRequest,
|
|
57
|
+
): string {
|
|
58
|
+
return JSON.stringify(
|
|
59
|
+
ExecuteSubscriptionModifyRequest$outboundSchema.parse(
|
|
60
|
+
executeSubscriptionModifyRequest,
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
}
|
package/src/sdk/models/index.ts
CHANGED
|
@@ -45,6 +45,19 @@ export * from "./cancel-subscription-request.js";
|
|
|
45
45
|
export * from "./cancel-subscription-response.js";
|
|
46
46
|
export * from "./cancel-subscription-schedule-op.js";
|
|
47
47
|
export * from "./cancellation-type.js";
|
|
48
|
+
export * from "./changed-invoice-action.js";
|
|
49
|
+
export * from "./changed-invoice-status.js";
|
|
50
|
+
export * from "./changed-invoice.js";
|
|
51
|
+
export * from "./changed-line-item-action.js";
|
|
52
|
+
export * from "./changed-line-item.js";
|
|
53
|
+
export * from "./changed-resources.js";
|
|
54
|
+
export * from "./changed-subscription-action.js";
|
|
55
|
+
export * from "./changed-subscription.js";
|
|
56
|
+
export * from "./clone-environment-op.js";
|
|
57
|
+
export * from "./clone-environment-request.js";
|
|
58
|
+
export * from "./clone-feature-op.js";
|
|
59
|
+
export * from "./clone-feature-request.js";
|
|
60
|
+
export * from "./clone-plan-op.js";
|
|
48
61
|
export * from "./clone-plan-request.js";
|
|
49
62
|
export * from "./collection-method.js";
|
|
50
63
|
export * from "./commitment-info.js";
|
|
@@ -154,13 +167,14 @@ export * from "./entitlement-source.js";
|
|
|
154
167
|
export * from "./entitlement-usage-reset-period.js";
|
|
155
168
|
export * from "./entity-integration-mapping-response.js";
|
|
156
169
|
export * from "./entity-type.js";
|
|
170
|
+
export * from "./environment-type.js";
|
|
157
171
|
export * from "./errors-error-response.js";
|
|
158
172
|
export * from "./event-cost-info.js";
|
|
159
173
|
export * from "./event-processing-status-type.js";
|
|
160
174
|
export * from "./event.js";
|
|
161
175
|
export * from "./execute-subscription-change-op.js";
|
|
162
|
-
export * from "./execute-subscription-inheritance-request.js";
|
|
163
176
|
export * from "./execute-subscription-modify-op.js";
|
|
177
|
+
export * from "./execute-subscription-modify-request.js";
|
|
164
178
|
export * from "./failure-point-type.js";
|
|
165
179
|
export * from "./failure-point.js";
|
|
166
180
|
export * from "./feature-filter.js";
|
|
@@ -254,6 +268,7 @@ export * from "./invoice-response.js";
|
|
|
254
268
|
export * from "./invoice-status.js";
|
|
255
269
|
export * from "./invoice-type.js";
|
|
256
270
|
export * from "./line-item-commitment-config.js";
|
|
271
|
+
export * from "./line-item-quantity-change.js";
|
|
257
272
|
export * from "./link-integration-mapping-request.js";
|
|
258
273
|
export * from "./link-integration-mapping-response.js";
|
|
259
274
|
export * from "./list-addons-response.js";
|
|
@@ -298,6 +313,11 @@ export * from "./meter-filter.js";
|
|
|
298
313
|
export * from "./meter-matching-result.js";
|
|
299
314
|
export * from "./meter-meter.js";
|
|
300
315
|
export * from "./meter-response.js";
|
|
316
|
+
export * from "./meter-usage-analytics-request.js";
|
|
317
|
+
export * from "./meter-usage-analytics-response.js";
|
|
318
|
+
export * from "./meter-usage-point.js";
|
|
319
|
+
export * from "./meter-usage-query-request.js";
|
|
320
|
+
export * from "./meter-usage-query-response.js";
|
|
301
321
|
export * from "./models-temporal-workflow-result.js";
|
|
302
322
|
export * from "./override-entitlement-request.js";
|
|
303
323
|
export * from "./override-line-item-request.js";
|
|
@@ -318,8 +338,8 @@ export * from "./plan-filter.js";
|
|
|
318
338
|
export * from "./plan-response.js";
|
|
319
339
|
export * from "./plan-summary.js";
|
|
320
340
|
export * from "./plan.js";
|
|
321
|
-
export * from "./post-plans-id-clone-op.js";
|
|
322
341
|
export * from "./preview-subscription-change-op.js";
|
|
342
|
+
export * from "./preview-subscription-modify-op.js";
|
|
323
343
|
export * from "./price-entity-type.js";
|
|
324
344
|
export * from "./price-filter.js";
|
|
325
345
|
export * from "./price-jsonb-transform-quantity.js";
|
|
@@ -369,6 +389,8 @@ export * from "./sort-condition.js";
|
|
|
369
389
|
export * from "./sort-direction.js";
|
|
370
390
|
export * from "./source-usage-item.js";
|
|
371
391
|
export * from "./status.js";
|
|
392
|
+
export * from "./sub-modify-inheritance-request.js";
|
|
393
|
+
export * from "./sub-modify-quantity-change-request.js";
|
|
372
394
|
export * from "./subscription-change-execute-response.js";
|
|
373
395
|
export * from "./subscription-change-preview-response.js";
|
|
374
396
|
export * from "./subscription-change-request.js";
|
|
@@ -379,6 +401,8 @@ export * from "./subscription-inheritance-config.js";
|
|
|
379
401
|
export * from "./subscription-line-item-entity-type.js";
|
|
380
402
|
export * from "./subscription-line-item-lookup-result.js";
|
|
381
403
|
export * from "./subscription-line-item-response.js";
|
|
404
|
+
export * from "./subscription-modify-response.js";
|
|
405
|
+
export * from "./subscription-modify-type.js";
|
|
382
406
|
export * from "./subscription-pause-response.js";
|
|
383
407
|
export * from "./subscription-phase-create-request.js";
|
|
384
408
|
export * from "./subscription-phase-response.js";
|
|
@@ -112,6 +112,10 @@ export type InvoiceFilter = {
|
|
|
112
112
|
sort?: Array<SortCondition> | undefined;
|
|
113
113
|
startTime?: Date | undefined;
|
|
114
114
|
status?: Status | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* subscription_customer_id filters invoices by the subscription owner's customer ID
|
|
117
|
+
*/
|
|
118
|
+
subscriptionCustomerId?: Array<string> | undefined;
|
|
115
119
|
/**
|
|
116
120
|
* subscription_id filters invoices generated for a specific subscription
|
|
117
121
|
*
|
|
@@ -150,6 +154,7 @@ export type InvoiceFilter$Outbound = {
|
|
|
150
154
|
sort?: Array<SortCondition$Outbound> | undefined;
|
|
151
155
|
start_time?: string | undefined;
|
|
152
156
|
status?: string | undefined;
|
|
157
|
+
subscription_customer_id?: Array<string> | undefined;
|
|
153
158
|
subscription_id?: string | undefined;
|
|
154
159
|
};
|
|
155
160
|
|
|
@@ -181,6 +186,7 @@ export const InvoiceFilter$outboundSchema: z.ZodMiniType<
|
|
|
181
186
|
sort: z.optional(z.array(SortCondition$outboundSchema)),
|
|
182
187
|
startTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
183
188
|
status: z.optional(Status$outboundSchema),
|
|
189
|
+
subscriptionCustomerId: z.optional(z.array(z.string())),
|
|
184
190
|
subscriptionId: z.optional(z.string()),
|
|
185
191
|
}),
|
|
186
192
|
z.transform((v) => {
|
|
@@ -200,6 +206,7 @@ export const InvoiceFilter$outboundSchema: z.ZodMiniType<
|
|
|
200
206
|
periodStartLte: "period_start_lte",
|
|
201
207
|
skipLineItems: "skip_line_items",
|
|
202
208
|
startTime: "start_time",
|
|
209
|
+
subscriptionCustomerId: "subscription_customer_id",
|
|
203
210
|
subscriptionId: "subscription_id",
|
|
204
211
|
});
|
|
205
212
|
}),
|
|
@@ -165,6 +165,13 @@ export type InvoiceResponse = {
|
|
|
165
165
|
refundedAmount?: string | undefined;
|
|
166
166
|
status?: Status | undefined;
|
|
167
167
|
subscription?: SubscriptionResponse | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID).
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* It may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB.
|
|
173
|
+
*/
|
|
174
|
+
subscriptionCustomerId?: string | undefined;
|
|
168
175
|
/**
|
|
169
176
|
* subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices)
|
|
170
177
|
*/
|
|
@@ -251,6 +258,7 @@ export const InvoiceResponse$inboundSchema: z.ZodMiniType<
|
|
|
251
258
|
subscription: types.optional(
|
|
252
259
|
z.lazy(() => SubscriptionResponse$inboundSchema),
|
|
253
260
|
),
|
|
261
|
+
subscription_customer_id: types.optional(types.string()),
|
|
254
262
|
subscription_id: types.optional(types.string()),
|
|
255
263
|
subtotal: types.optional(types.string()),
|
|
256
264
|
taxes: types.optional(z.array(TaxAppliedResponse$inboundSchema)),
|
|
@@ -294,6 +302,7 @@ export const InvoiceResponse$inboundSchema: z.ZodMiniType<
|
|
|
294
302
|
"period_start": "periodStart",
|
|
295
303
|
"recalculated_invoice_id": "recalculatedInvoiceId",
|
|
296
304
|
"refunded_amount": "refundedAmount",
|
|
305
|
+
"subscription_customer_id": "subscriptionCustomerId",
|
|
297
306
|
"subscription_id": "subscriptionId",
|
|
298
307
|
"tenant_id": "tenantId",
|
|
299
308
|
"total_discount": "totalDiscount",
|
|
@@ -0,0 +1,52 @@
|
|
|
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 LineItemQuantityChange = {
|
|
9
|
+
/**
|
|
10
|
+
* EffectiveDate is when the quantity change takes effect.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* If omitted, the change is effective immediately (now).
|
|
14
|
+
*/
|
|
15
|
+
effectiveDate?: Date | undefined;
|
|
16
|
+
id: string;
|
|
17
|
+
quantity: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type LineItemQuantityChange$Outbound = {
|
|
22
|
+
effective_date?: string | undefined;
|
|
23
|
+
id: string;
|
|
24
|
+
quantity: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const LineItemQuantityChange$outboundSchema: z.ZodMiniType<
|
|
29
|
+
LineItemQuantityChange$Outbound,
|
|
30
|
+
LineItemQuantityChange
|
|
31
|
+
> = z.pipe(
|
|
32
|
+
z.object({
|
|
33
|
+
effectiveDate: z.optional(
|
|
34
|
+
z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
35
|
+
),
|
|
36
|
+
id: z.string(),
|
|
37
|
+
quantity: z.string(),
|
|
38
|
+
}),
|
|
39
|
+
z.transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
effectiveDate: "effective_date",
|
|
42
|
+
});
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export function lineItemQuantityChangeToJSON(
|
|
47
|
+
lineItemQuantityChange: LineItemQuantityChange,
|
|
48
|
+
): string {
|
|
49
|
+
return JSON.stringify(
|
|
50
|
+
LineItemQuantityChange$outboundSchema.parse(lineItemQuantityChange),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 {
|
|
8
|
+
AggregationType,
|
|
9
|
+
AggregationType$outboundSchema,
|
|
10
|
+
} from "./aggregation-type.js";
|
|
11
|
+
import { WindowSize, WindowSize$outboundSchema } from "./window-size.js";
|
|
12
|
+
|
|
13
|
+
export type MeterUsageAnalyticsRequest = {
|
|
14
|
+
aggregationType: AggregationType;
|
|
15
|
+
billingAnchor?: Date | undefined;
|
|
16
|
+
endTime: Date;
|
|
17
|
+
externalCustomerId: string;
|
|
18
|
+
meterIds: Array<string>;
|
|
19
|
+
startTime: Date;
|
|
20
|
+
windowSize?: WindowSize | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type MeterUsageAnalyticsRequest$Outbound = {
|
|
25
|
+
aggregation_type: string;
|
|
26
|
+
billing_anchor?: string | undefined;
|
|
27
|
+
end_time: string;
|
|
28
|
+
external_customer_id: string;
|
|
29
|
+
meter_ids: Array<string>;
|
|
30
|
+
start_time: string;
|
|
31
|
+
window_size?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const MeterUsageAnalyticsRequest$outboundSchema: z.ZodMiniType<
|
|
36
|
+
MeterUsageAnalyticsRequest$Outbound,
|
|
37
|
+
MeterUsageAnalyticsRequest
|
|
38
|
+
> = z.pipe(
|
|
39
|
+
z.object({
|
|
40
|
+
aggregationType: AggregationType$outboundSchema,
|
|
41
|
+
billingAnchor: z.optional(
|
|
42
|
+
z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
43
|
+
),
|
|
44
|
+
endTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
45
|
+
externalCustomerId: z.string(),
|
|
46
|
+
meterIds: z.array(z.string()),
|
|
47
|
+
startTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
48
|
+
windowSize: z.optional(WindowSize$outboundSchema),
|
|
49
|
+
}),
|
|
50
|
+
z.transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
aggregationType: "aggregation_type",
|
|
53
|
+
billingAnchor: "billing_anchor",
|
|
54
|
+
endTime: "end_time",
|
|
55
|
+
externalCustomerId: "external_customer_id",
|
|
56
|
+
meterIds: "meter_ids",
|
|
57
|
+
startTime: "start_time",
|
|
58
|
+
windowSize: "window_size",
|
|
59
|
+
});
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export function meterUsageAnalyticsRequestToJSON(
|
|
64
|
+
meterUsageAnalyticsRequest: MeterUsageAnalyticsRequest,
|
|
65
|
+
): string {
|
|
66
|
+
return JSON.stringify(
|
|
67
|
+
MeterUsageAnalyticsRequest$outboundSchema.parse(meterUsageAnalyticsRequest),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
MeterUsageQueryResponse,
|
|
11
|
+
MeterUsageQueryResponse$inboundSchema,
|
|
12
|
+
} from "./meter-usage-query-response.js";
|
|
13
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
14
|
+
|
|
15
|
+
export type MeterUsageAnalyticsResponse = {
|
|
16
|
+
items?: Array<MeterUsageQueryResponse> | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const MeterUsageAnalyticsResponse$inboundSchema: z.ZodMiniType<
|
|
21
|
+
MeterUsageAnalyticsResponse,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
items: types.optional(z.array(MeterUsageQueryResponse$inboundSchema)),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function meterUsageAnalyticsResponseFromJSON(
|
|
28
|
+
jsonString: string,
|
|
29
|
+
): SafeParseResult<MeterUsageAnalyticsResponse, SDKValidationError> {
|
|
30
|
+
return safeParse(
|
|
31
|
+
jsonString,
|
|
32
|
+
(x) => MeterUsageAnalyticsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
33
|
+
`Failed to parse 'MeterUsageAnalyticsResponse' from JSON`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
11
|
+
|
|
12
|
+
export type MeterUsagePoint = {
|
|
13
|
+
eventCount?: number | undefined;
|
|
14
|
+
timestamp?: string | undefined;
|
|
15
|
+
value?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const MeterUsagePoint$inboundSchema: z.ZodMiniType<
|
|
20
|
+
MeterUsagePoint,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.pipe(
|
|
23
|
+
z.object({
|
|
24
|
+
event_count: types.optional(types.number()),
|
|
25
|
+
timestamp: types.optional(types.string()),
|
|
26
|
+
value: types.optional(types.string()),
|
|
27
|
+
}),
|
|
28
|
+
z.transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"event_count": "eventCount",
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export function meterUsagePointFromJSON(
|
|
36
|
+
jsonString: string,
|
|
37
|
+
): SafeParseResult<MeterUsagePoint, SDKValidationError> {
|
|
38
|
+
return safeParse(
|
|
39
|
+
jsonString,
|
|
40
|
+
(x) => MeterUsagePoint$inboundSchema.parse(JSON.parse(x)),
|
|
41
|
+
`Failed to parse 'MeterUsagePoint' from JSON`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 {
|
|
8
|
+
AggregationType,
|
|
9
|
+
AggregationType$outboundSchema,
|
|
10
|
+
} from "./aggregation-type.js";
|
|
11
|
+
import { WindowSize, WindowSize$outboundSchema } from "./window-size.js";
|
|
12
|
+
|
|
13
|
+
export type MeterUsageQueryRequest = {
|
|
14
|
+
aggregationType: AggregationType;
|
|
15
|
+
billingAnchor?: Date | undefined;
|
|
16
|
+
endTime: Date;
|
|
17
|
+
externalCustomerId: string;
|
|
18
|
+
meterId: string;
|
|
19
|
+
startTime: Date;
|
|
20
|
+
windowSize?: WindowSize | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type MeterUsageQueryRequest$Outbound = {
|
|
25
|
+
aggregation_type: string;
|
|
26
|
+
billing_anchor?: string | undefined;
|
|
27
|
+
end_time: string;
|
|
28
|
+
external_customer_id: string;
|
|
29
|
+
meter_id: string;
|
|
30
|
+
start_time: string;
|
|
31
|
+
window_size?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const MeterUsageQueryRequest$outboundSchema: z.ZodMiniType<
|
|
36
|
+
MeterUsageQueryRequest$Outbound,
|
|
37
|
+
MeterUsageQueryRequest
|
|
38
|
+
> = z.pipe(
|
|
39
|
+
z.object({
|
|
40
|
+
aggregationType: AggregationType$outboundSchema,
|
|
41
|
+
billingAnchor: z.optional(
|
|
42
|
+
z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
43
|
+
),
|
|
44
|
+
endTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
45
|
+
externalCustomerId: z.string(),
|
|
46
|
+
meterId: z.string(),
|
|
47
|
+
startTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
48
|
+
windowSize: z.optional(WindowSize$outboundSchema),
|
|
49
|
+
}),
|
|
50
|
+
z.transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
aggregationType: "aggregation_type",
|
|
53
|
+
billingAnchor: "billing_anchor",
|
|
54
|
+
endTime: "end_time",
|
|
55
|
+
externalCustomerId: "external_customer_id",
|
|
56
|
+
meterId: "meter_id",
|
|
57
|
+
startTime: "start_time",
|
|
58
|
+
windowSize: "window_size",
|
|
59
|
+
});
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export function meterUsageQueryRequestToJSON(
|
|
64
|
+
meterUsageQueryRequest: MeterUsageQueryRequest,
|
|
65
|
+
): string {
|
|
66
|
+
return JSON.stringify(
|
|
67
|
+
MeterUsageQueryRequest$outboundSchema.parse(meterUsageQueryRequest),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
AggregationType,
|
|
12
|
+
AggregationType$inboundSchema,
|
|
13
|
+
} from "./aggregation-type.js";
|
|
14
|
+
import {
|
|
15
|
+
MeterUsagePoint,
|
|
16
|
+
MeterUsagePoint$inboundSchema,
|
|
17
|
+
} from "./meter-usage-point.js";
|
|
18
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
19
|
+
|
|
20
|
+
export type MeterUsageQueryResponse = {
|
|
21
|
+
aggregationType?: AggregationType | undefined;
|
|
22
|
+
eventCount?: number | undefined;
|
|
23
|
+
meterId?: string | undefined;
|
|
24
|
+
points?: Array<MeterUsagePoint> | undefined;
|
|
25
|
+
totalValue?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const MeterUsageQueryResponse$inboundSchema: z.ZodMiniType<
|
|
30
|
+
MeterUsageQueryResponse,
|
|
31
|
+
unknown
|
|
32
|
+
> = z.pipe(
|
|
33
|
+
z.object({
|
|
34
|
+
aggregation_type: types.optional(AggregationType$inboundSchema),
|
|
35
|
+
event_count: types.optional(types.number()),
|
|
36
|
+
meter_id: types.optional(types.string()),
|
|
37
|
+
points: types.optional(z.array(MeterUsagePoint$inboundSchema)),
|
|
38
|
+
total_value: types.optional(types.string()),
|
|
39
|
+
}),
|
|
40
|
+
z.transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"aggregation_type": "aggregationType",
|
|
43
|
+
"event_count": "eventCount",
|
|
44
|
+
"meter_id": "meterId",
|
|
45
|
+
"total_value": "totalValue",
|
|
46
|
+
});
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export function meterUsageQueryResponseFromJSON(
|
|
51
|
+
jsonString: string,
|
|
52
|
+
): SafeParseResult<MeterUsageQueryResponse, SDKValidationError> {
|
|
53
|
+
return safeParse(
|
|
54
|
+
jsonString,
|
|
55
|
+
(x) => MeterUsageQueryResponse$inboundSchema.parse(JSON.parse(x)),
|
|
56
|
+
`Failed to parse 'MeterUsageQueryResponse' from JSON`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
ExecuteSubscriptionModifyRequest,
|
|
8
|
+
ExecuteSubscriptionModifyRequest$Outbound,
|
|
9
|
+
ExecuteSubscriptionModifyRequest$outboundSchema,
|
|
10
|
+
} from "./execute-subscription-modify-request.js";
|
|
11
|
+
|
|
12
|
+
export type PreviewSubscriptionModifyRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* Subscription ID
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Modification preview request
|
|
19
|
+
*/
|
|
20
|
+
body: ExecuteSubscriptionModifyRequest;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type PreviewSubscriptionModifyRequest$Outbound = {
|
|
25
|
+
id: string;
|
|
26
|
+
body: ExecuteSubscriptionModifyRequest$Outbound;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const PreviewSubscriptionModifyRequest$outboundSchema: z.ZodMiniType<
|
|
31
|
+
PreviewSubscriptionModifyRequest$Outbound,
|
|
32
|
+
PreviewSubscriptionModifyRequest
|
|
33
|
+
> = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
body: ExecuteSubscriptionModifyRequest$outboundSchema,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function previewSubscriptionModifyRequestToJSON(
|
|
39
|
+
previewSubscriptionModifyRequest: PreviewSubscriptionModifyRequest,
|
|
40
|
+
): string {
|
|
41
|
+
return JSON.stringify(
|
|
42
|
+
PreviewSubscriptionModifyRequest$outboundSchema.parse(
|
|
43
|
+
previewSubscriptionModifyRequest,
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
}
|