/* * 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 GetInvoiceRequest = { /** * Invoice ID */ id: string; /** * Include source-level price breakdown for usage line items (legacy) */ expandBySource?: boolean | undefined; /** * Group usage breakdown by specified fields (e.g., source, feature_id, properties.org_id) */ groupBy?: Array | undefined; /** * Comma-separated related fields to include. Supports 'tax_applied.tax_rate' to attach rate details to each applied tax. */ expand?: string | undefined; }; /** @internal */ export type GetInvoiceRequest$Outbound = { id: string; expand_by_source?: boolean | undefined; group_by?: Array | undefined; expand?: string | undefined; }; /** @internal */ export const GetInvoiceRequest$outboundSchema: z.ZodMiniType< GetInvoiceRequest$Outbound, GetInvoiceRequest > = z.pipe( z.object({ id: z.string(), expandBySource: z.optional(z.boolean()), groupBy: z.optional(z.array(z.string())), expand: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { expandBySource: "expand_by_source", groupBy: "group_by", }); }), ); export function getInvoiceRequestToJSON( getInvoiceRequest: GetInvoiceRequest, ): string { return JSON.stringify( GetInvoiceRequest$outboundSchema.parse(getInvoiceRequest), ); }