/* * 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"; export type GetPreviewInvoiceRequest = { /** * hide_zero_charges_line_items indicates whether to hide line items with zero cost */ hideZeroChargesLineItems?: boolean | undefined; /** * period_end is the optional end date of the period to preview */ periodEnd?: Date | undefined; /** * period_start is the optional start date of the period to preview */ periodStart?: Date | undefined; /** * subscription_id is the unique identifier of the subscription to preview invoice for */ subscriptionId: string; }; /** @internal */ export type GetPreviewInvoiceRequest$Outbound = { hide_zero_charges_line_items: boolean; period_end?: string | undefined; period_start?: string | undefined; subscription_id: string; }; /** @internal */ export const GetPreviewInvoiceRequest$outboundSchema: z.ZodMiniType< GetPreviewInvoiceRequest$Outbound, GetPreviewInvoiceRequest > = z.pipe( z.object({ hideZeroChargesLineItems: z._default(z.boolean(), false), periodEnd: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), periodStart: z.optional( z.pipe(z.date(), z.transform(v => v.toISOString())), ), subscriptionId: z.string(), }), z.transform((v) => { return remap$(v, { hideZeroChargesLineItems: "hide_zero_charges_line_items", periodEnd: "period_end", periodStart: "period_start", subscriptionId: "subscription_id", }); }), ); export function getPreviewInvoiceRequestToJSON( getPreviewInvoiceRequest: GetPreviewInvoiceRequest, ): string { return JSON.stringify( GetPreviewInvoiceRequest$outboundSchema.parse(getPreviewInvoiceRequest), ); }