/* * 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 UpdateInvoiceRequest = { /** * When true, recalculates discount from existing coupon associations (draft invoices only). */ applyDiscount?: boolean | undefined; dueDate?: Date | undefined; /** * invoice_pdf_url is the URL where customers can download the PDF version of this invoice */ invoicePdfUrl?: string | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export type UpdateInvoiceRequest$Outbound = { apply_discount?: boolean | undefined; due_date?: string | undefined; invoice_pdf_url?: string | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const UpdateInvoiceRequest$outboundSchema: z.ZodMiniType< UpdateInvoiceRequest$Outbound, UpdateInvoiceRequest > = z.pipe( z.object({ applyDiscount: z.optional(z.boolean()), dueDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), invoicePdfUrl: z.optional(z.string()), metadata: z.optional(z.record(z.string(), z.string())), }), z.transform((v) => { return remap$(v, { applyDiscount: "apply_discount", dueDate: "due_date", invoicePdfUrl: "invoice_pdf_url", }); }), ); export function updateInvoiceRequestToJSON( updateInvoiceRequest: UpdateInvoiceRequest, ): string { return JSON.stringify( UpdateInvoiceRequest$outboundSchema.parse(updateInvoiceRequest), ); }