/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type InvoiceLineItemPreview = { /** * amount for this line item */ amount?: string | undefined; /** * description of the line item */ description?: string | undefined; /** * is_proration indicates if this line item is a proration */ isProration?: boolean | undefined; /** * period_end for this line item (if applicable) */ periodEnd?: Date | undefined; /** * period_start for this line item (if applicable) */ periodStart?: Date | undefined; /** * quantity for this line item */ quantity?: string | undefined; /** * unit_price for this line item */ unitPrice?: string | undefined; }; /** @internal */ export const InvoiceLineItemPreview$inboundSchema: z.ZodMiniType< InvoiceLineItemPreview, unknown > = z.pipe( z.object({ amount: types.optional(types.string()), description: types.optional(types.string()), is_proration: types.optional(types.boolean()), period_end: types.optional(types.date()), period_start: types.optional(types.date()), quantity: types.optional(types.string()), unit_price: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "is_proration": "isProration", "period_end": "periodEnd", "period_start": "periodStart", "unit_price": "unitPrice", }); }), ); export function invoiceLineItemPreviewFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InvoiceLineItemPreview$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvoiceLineItemPreview' from JSON`, ); }