@flexprice/sdk 2.1.1 → 2.1.2
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.md +17 -0
- package/docs/sdk/models/changed-line-item.md +20 -0
- package/docs/sdk/models/changed-resources.md +17 -0
- package/docs/sdk/models/changed-subscription.md +17 -0
- package/docs/sdk/models/create-price-request.md +7 -9
- package/docs/sdk/models/create-subscription-request.md +2 -4
- 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 +25 -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/sdk/models/window-size.md +2 -2
- package/docs/sdks/invoices/README.md +76 -0
- package/docs/sdks/meterusage/README.md +182 -0
- package/docs/sdks/prices/README.md +12 -14
- package/docs/sdks/subscriptions/README.md +101 -22
- 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/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/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.d.ts +15 -0
- package/esm/sdk/models/changed-invoice.d.ts.map +1 -0
- package/esm/sdk/models/changed-invoice.js +16 -0
- package/esm/sdk/models/changed-invoice.js.map +1 -0
- package/esm/sdk/models/changed-line-item.d.ts +18 -0
- package/esm/sdk/models/changed-line-item.d.ts.map +1 -0
- package/esm/sdk/models/changed-line-item.js +27 -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.d.ts +16 -0
- package/esm/sdk/models/changed-subscription.d.ts.map +1 -0
- package/esm/sdk/models/changed-subscription.js +17 -0
- package/esm/sdk/models/changed-subscription.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 +0 -3
- package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
- package/esm/sdk/models/create-subscription-request.js +0 -3
- package/esm/sdk/models/create-subscription-request.js.map +1 -1
- 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 +16 -1
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +16 -1
- 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/models/window-size.d.ts +1 -1
- package/esm/sdk/models/window-size.js +1 -1
- package/esm/sdk/models/window-size.js.map +1 -1
- 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/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 +1 -1
- 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/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/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.ts +38 -0
- package/src/sdk/models/changed-line-item.ts +55 -0
- package/src/sdk/models/changed-resources.ts +55 -0
- package/src/sdk/models/changed-subscription.ts +42 -0
- package/src/sdk/models/create-price-request.ts +0 -8
- package/src/sdk/models/create-subscription-request.ts +0 -8
- 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 +16 -1
- 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/models/window-size.ts +1 -1
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/subscriptions.ts +24 -4
- 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/src/sdk/models/execute-subscription-inheritance-request.ts +0 -42
|
@@ -3,22 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
|
-
import
|
|
7
|
-
import { OpenEnum } from "../../types/enums.js";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
|
|
9
8
|
export const BillingCadence = {
|
|
10
9
|
Recurring: "RECURRING",
|
|
11
|
-
Onetime: "ONETIME",
|
|
12
10
|
} as const;
|
|
13
|
-
export type BillingCadence =
|
|
11
|
+
export type BillingCadence = ClosedEnum<typeof BillingCadence>;
|
|
14
12
|
|
|
15
13
|
/** @internal */
|
|
16
|
-
export const BillingCadence$inboundSchema: z.
|
|
17
|
-
BillingCadence
|
|
18
|
-
|
|
19
|
-
> = openEnums.inboundSchema(BillingCadence);
|
|
14
|
+
export const BillingCadence$inboundSchema: z.ZodMiniEnum<
|
|
15
|
+
typeof BillingCadence
|
|
16
|
+
> = z.enum(BillingCadence);
|
|
20
17
|
/** @internal */
|
|
21
|
-
export const BillingCadence$outboundSchema: z.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> = openEnums.outboundSchema(BillingCadence);
|
|
18
|
+
export const BillingCadence$outboundSchema: z.ZodMiniEnum<
|
|
19
|
+
typeof BillingCadence
|
|
20
|
+
> = BillingCadence$inboundSchema;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { SDKValidationError } from "./sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type ChangedInvoice = {
|
|
12
|
+
/**
|
|
13
|
+
* "created" | "wallet_credit"
|
|
14
|
+
*/
|
|
15
|
+
action?: string | undefined;
|
|
16
|
+
id?: string | undefined;
|
|
17
|
+
status?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const ChangedInvoice$inboundSchema: z.ZodMiniType<
|
|
22
|
+
ChangedInvoice,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
action: types.optional(types.string()),
|
|
26
|
+
id: types.optional(types.string()),
|
|
27
|
+
status: types.optional(types.string()),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function changedInvoiceFromJSON(
|
|
31
|
+
jsonString: string,
|
|
32
|
+
): SafeParseResult<ChangedInvoice, SDKValidationError> {
|
|
33
|
+
return safeParse(
|
|
34
|
+
jsonString,
|
|
35
|
+
(x) => ChangedInvoice$inboundSchema.parse(JSON.parse(x)),
|
|
36
|
+
`Failed to parse 'ChangedInvoice' from JSON`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 ChangedLineItem = {
|
|
13
|
+
/**
|
|
14
|
+
* "created" | "updated" | "ended"
|
|
15
|
+
*/
|
|
16
|
+
changeAction?: string | undefined;
|
|
17
|
+
endDate?: Date | undefined;
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
priceId?: string | undefined;
|
|
20
|
+
quantity?: string | undefined;
|
|
21
|
+
startDate?: Date | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const ChangedLineItem$inboundSchema: z.ZodMiniType<
|
|
26
|
+
ChangedLineItem,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.pipe(
|
|
29
|
+
z.object({
|
|
30
|
+
change_action: types.optional(types.string()),
|
|
31
|
+
end_date: types.optional(types.date()),
|
|
32
|
+
id: types.optional(types.string()),
|
|
33
|
+
price_id: types.optional(types.string()),
|
|
34
|
+
quantity: types.optional(types.string()),
|
|
35
|
+
start_date: types.optional(types.date()),
|
|
36
|
+
}),
|
|
37
|
+
z.transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
"change_action": "changeAction",
|
|
40
|
+
"end_date": "endDate",
|
|
41
|
+
"price_id": "priceId",
|
|
42
|
+
"start_date": "startDate",
|
|
43
|
+
});
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export function changedLineItemFromJSON(
|
|
48
|
+
jsonString: string,
|
|
49
|
+
): SafeParseResult<ChangedLineItem, SDKValidationError> {
|
|
50
|
+
return safeParse(
|
|
51
|
+
jsonString,
|
|
52
|
+
(x) => ChangedLineItem$inboundSchema.parse(JSON.parse(x)),
|
|
53
|
+
`Failed to parse 'ChangedLineItem' from JSON`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
ChangedInvoice,
|
|
12
|
+
ChangedInvoice$inboundSchema,
|
|
13
|
+
} from "./changed-invoice.js";
|
|
14
|
+
import {
|
|
15
|
+
ChangedLineItem,
|
|
16
|
+
ChangedLineItem$inboundSchema,
|
|
17
|
+
} from "./changed-line-item.js";
|
|
18
|
+
import {
|
|
19
|
+
ChangedSubscription,
|
|
20
|
+
ChangedSubscription$inboundSchema,
|
|
21
|
+
} from "./changed-subscription.js";
|
|
22
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
23
|
+
|
|
24
|
+
export type ChangedResources = {
|
|
25
|
+
invoices?: Array<ChangedInvoice> | undefined;
|
|
26
|
+
lineItems?: Array<ChangedLineItem> | undefined;
|
|
27
|
+
subscriptions?: Array<ChangedSubscription> | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const ChangedResources$inboundSchema: z.ZodMiniType<
|
|
32
|
+
ChangedResources,
|
|
33
|
+
unknown
|
|
34
|
+
> = z.pipe(
|
|
35
|
+
z.object({
|
|
36
|
+
invoices: types.optional(z.array(ChangedInvoice$inboundSchema)),
|
|
37
|
+
line_items: types.optional(z.array(ChangedLineItem$inboundSchema)),
|
|
38
|
+
subscriptions: types.optional(z.array(ChangedSubscription$inboundSchema)),
|
|
39
|
+
}),
|
|
40
|
+
z.transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"line_items": "lineItems",
|
|
43
|
+
});
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export function changedResourcesFromJSON(
|
|
48
|
+
jsonString: string,
|
|
49
|
+
): SafeParseResult<ChangedResources, SDKValidationError> {
|
|
50
|
+
return safeParse(
|
|
51
|
+
jsonString,
|
|
52
|
+
(x) => ChangedResources$inboundSchema.parse(JSON.parse(x)),
|
|
53
|
+
`Failed to parse 'ChangedResources' from JSON`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { SDKValidationError } from "./sdk-validation-error.js";
|
|
10
|
+
import {
|
|
11
|
+
SubscriptionStatus,
|
|
12
|
+
SubscriptionStatus$inboundSchema,
|
|
13
|
+
} from "./subscription-status.js";
|
|
14
|
+
|
|
15
|
+
export type ChangedSubscription = {
|
|
16
|
+
/**
|
|
17
|
+
* "created" | "updated"
|
|
18
|
+
*/
|
|
19
|
+
action?: string | undefined;
|
|
20
|
+
id?: string | undefined;
|
|
21
|
+
status?: SubscriptionStatus | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const ChangedSubscription$inboundSchema: z.ZodMiniType<
|
|
26
|
+
ChangedSubscription,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
action: types.optional(types.string()),
|
|
30
|
+
id: types.optional(types.string()),
|
|
31
|
+
status: types.optional(SubscriptionStatus$inboundSchema),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function changedSubscriptionFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<ChangedSubscription, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => ChangedSubscription$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'ChangedSubscription' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
8
|
-
BillingCadence,
|
|
9
|
-
BillingCadence$outboundSchema,
|
|
10
|
-
} from "./billing-cadence.js";
|
|
11
7
|
import { BillingModel, BillingModel$outboundSchema } from "./billing-model.js";
|
|
12
8
|
import {
|
|
13
9
|
BillingPeriod,
|
|
@@ -45,7 +41,6 @@ import {
|
|
|
45
41
|
|
|
46
42
|
export type CreatePriceRequest = {
|
|
47
43
|
amount?: string | undefined;
|
|
48
|
-
billingCadence: BillingCadence;
|
|
49
44
|
billingModel: BillingModel;
|
|
50
45
|
billingPeriod: BillingPeriod;
|
|
51
46
|
billingPeriodCount?: number | undefined;
|
|
@@ -81,7 +76,6 @@ export type CreatePriceRequest = {
|
|
|
81
76
|
/** @internal */
|
|
82
77
|
export type CreatePriceRequest$Outbound = {
|
|
83
78
|
amount?: string | undefined;
|
|
84
|
-
billing_cadence: string;
|
|
85
79
|
billing_model: string;
|
|
86
80
|
billing_period: string;
|
|
87
81
|
billing_period_count?: number | undefined;
|
|
@@ -115,7 +109,6 @@ export const CreatePriceRequest$outboundSchema: z.ZodMiniType<
|
|
|
115
109
|
> = z.pipe(
|
|
116
110
|
z.object({
|
|
117
111
|
amount: z.optional(z.string()),
|
|
118
|
-
billingCadence: BillingCadence$outboundSchema,
|
|
119
112
|
billingModel: BillingModel$outboundSchema,
|
|
120
113
|
billingPeriod: BillingPeriod$outboundSchema,
|
|
121
114
|
billingPeriodCount: z.optional(z.int()),
|
|
@@ -143,7 +136,6 @@ export const CreatePriceRequest$outboundSchema: z.ZodMiniType<
|
|
|
143
136
|
}),
|
|
144
137
|
z.transform((v) => {
|
|
145
138
|
return remap$(v, {
|
|
146
|
-
billingCadence: "billing_cadence",
|
|
147
139
|
billingModel: "billing_model",
|
|
148
140
|
billingPeriod: "billing_period",
|
|
149
141
|
billingPeriodCount: "billing_period_count",
|
|
@@ -9,10 +9,6 @@ import {
|
|
|
9
9
|
AddAddonToSubscriptionRequest$Outbound,
|
|
10
10
|
AddAddonToSubscriptionRequest$outboundSchema,
|
|
11
11
|
} from "./add-addon-to-subscription-request.js";
|
|
12
|
-
import {
|
|
13
|
-
BillingCadence,
|
|
14
|
-
BillingCadence$outboundSchema,
|
|
15
|
-
} from "./billing-cadence.js";
|
|
16
12
|
import { BillingCycle, BillingCycle$outboundSchema } from "./billing-cycle.js";
|
|
17
13
|
import {
|
|
18
14
|
BillingPeriod,
|
|
@@ -81,7 +77,6 @@ export type CreateSubscriptionRequest = {
|
|
|
81
77
|
* Addons represents addons to be added to the subscription during creation
|
|
82
78
|
*/
|
|
83
79
|
addons?: Array<AddAddonToSubscriptionRequest> | undefined;
|
|
84
|
-
billingCadence: BillingCadence;
|
|
85
80
|
billingCycle?: BillingCycle | undefined;
|
|
86
81
|
billingPeriod: BillingPeriod;
|
|
87
82
|
billingPeriodCount?: number | undefined;
|
|
@@ -169,7 +164,6 @@ export type CreateSubscriptionRequest = {
|
|
|
169
164
|
/** @internal */
|
|
170
165
|
export type CreateSubscriptionRequest$Outbound = {
|
|
171
166
|
addons?: Array<AddAddonToSubscriptionRequest$Outbound> | undefined;
|
|
172
|
-
billing_cadence: string;
|
|
173
167
|
billing_cycle?: string | undefined;
|
|
174
168
|
billing_period: string;
|
|
175
169
|
billing_period_count?: number | undefined;
|
|
@@ -217,7 +211,6 @@ export const CreateSubscriptionRequest$outboundSchema: z.ZodMiniType<
|
|
|
217
211
|
> = z.pipe(
|
|
218
212
|
z.object({
|
|
219
213
|
addons: z.optional(z.array(AddAddonToSubscriptionRequest$outboundSchema)),
|
|
220
|
-
billingCadence: BillingCadence$outboundSchema,
|
|
221
214
|
billingCycle: z.optional(BillingCycle$outboundSchema),
|
|
222
215
|
billingPeriod: BillingPeriod$outboundSchema,
|
|
223
216
|
billingPeriodCount: z.optional(z.int()),
|
|
@@ -263,7 +256,6 @@ export const CreateSubscriptionRequest$outboundSchema: z.ZodMiniType<
|
|
|
263
256
|
}),
|
|
264
257
|
z.transform((v) => {
|
|
265
258
|
return remap$(v, {
|
|
266
|
-
billingCadence: "billing_cadence",
|
|
267
259
|
billingCycle: "billing_cycle",
|
|
268
260
|
billingPeriod: "billing_period",
|
|
269
261
|
billingPeriodCount: "billing_period_count",
|
|
@@ -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,10 @@ 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.js";
|
|
49
|
+
export * from "./changed-line-item.js";
|
|
50
|
+
export * from "./changed-resources.js";
|
|
51
|
+
export * from "./changed-subscription.js";
|
|
48
52
|
export * from "./clone-plan-request.js";
|
|
49
53
|
export * from "./collection-method.js";
|
|
50
54
|
export * from "./commitment-info.js";
|
|
@@ -159,8 +163,8 @@ export * from "./event-cost-info.js";
|
|
|
159
163
|
export * from "./event-processing-status-type.js";
|
|
160
164
|
export * from "./event.js";
|
|
161
165
|
export * from "./execute-subscription-change-op.js";
|
|
162
|
-
export * from "./execute-subscription-inheritance-request.js";
|
|
163
166
|
export * from "./execute-subscription-modify-op.js";
|
|
167
|
+
export * from "./execute-subscription-modify-request.js";
|
|
164
168
|
export * from "./failure-point-type.js";
|
|
165
169
|
export * from "./failure-point.js";
|
|
166
170
|
export * from "./feature-filter.js";
|
|
@@ -254,6 +258,7 @@ export * from "./invoice-response.js";
|
|
|
254
258
|
export * from "./invoice-status.js";
|
|
255
259
|
export * from "./invoice-type.js";
|
|
256
260
|
export * from "./line-item-commitment-config.js";
|
|
261
|
+
export * from "./line-item-quantity-change.js";
|
|
257
262
|
export * from "./link-integration-mapping-request.js";
|
|
258
263
|
export * from "./link-integration-mapping-response.js";
|
|
259
264
|
export * from "./list-addons-response.js";
|
|
@@ -298,6 +303,11 @@ export * from "./meter-filter.js";
|
|
|
298
303
|
export * from "./meter-matching-result.js";
|
|
299
304
|
export * from "./meter-meter.js";
|
|
300
305
|
export * from "./meter-response.js";
|
|
306
|
+
export * from "./meter-usage-analytics-request.js";
|
|
307
|
+
export * from "./meter-usage-analytics-response.js";
|
|
308
|
+
export * from "./meter-usage-point.js";
|
|
309
|
+
export * from "./meter-usage-query-request.js";
|
|
310
|
+
export * from "./meter-usage-query-response.js";
|
|
301
311
|
export * from "./models-temporal-workflow-result.js";
|
|
302
312
|
export * from "./override-entitlement-request.js";
|
|
303
313
|
export * from "./override-line-item-request.js";
|
|
@@ -320,6 +330,7 @@ export * from "./plan-summary.js";
|
|
|
320
330
|
export * from "./plan.js";
|
|
321
331
|
export * from "./post-plans-id-clone-op.js";
|
|
322
332
|
export * from "./preview-subscription-change-op.js";
|
|
333
|
+
export * from "./preview-subscription-modify-op.js";
|
|
323
334
|
export * from "./price-entity-type.js";
|
|
324
335
|
export * from "./price-filter.js";
|
|
325
336
|
export * from "./price-jsonb-transform-quantity.js";
|
|
@@ -369,6 +380,8 @@ export * from "./sort-condition.js";
|
|
|
369
380
|
export * from "./sort-direction.js";
|
|
370
381
|
export * from "./source-usage-item.js";
|
|
371
382
|
export * from "./status.js";
|
|
383
|
+
export * from "./sub-modify-inheritance-request.js";
|
|
384
|
+
export * from "./sub-modify-quantity-change-request.js";
|
|
372
385
|
export * from "./subscription-change-execute-response.js";
|
|
373
386
|
export * from "./subscription-change-preview-response.js";
|
|
374
387
|
export * from "./subscription-change-request.js";
|
|
@@ -379,6 +392,8 @@ export * from "./subscription-inheritance-config.js";
|
|
|
379
392
|
export * from "./subscription-line-item-entity-type.js";
|
|
380
393
|
export * from "./subscription-line-item-lookup-result.js";
|
|
381
394
|
export * from "./subscription-line-item-response.js";
|
|
395
|
+
export * from "./subscription-modify-response.js";
|
|
396
|
+
export * from "./subscription-modify-type.js";
|
|
382
397
|
export * from "./subscription-pause-response.js";
|
|
383
398
|
export * from "./subscription-phase-create-request.js";
|
|
384
399
|
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
|
+
}
|