/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LinkedInvoiceItem = { /** * ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item */ id?: string | null | undefined; /** * User defined item code */ code?: string | null | undefined; /** * User defined item name */ name?: string | null | undefined; }; /** @internal */ export const LinkedInvoiceItem$inboundSchema: z.ZodType< LinkedInvoiceItem, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(types.string()).optional(), code: z.nullable(types.string()).optional(), name: z.nullable(types.string()).optional(), }) ); /** @internal */ export type LinkedInvoiceItem$Outbound = { id?: string | null | undefined; code?: string | null | undefined; name?: string | null | undefined; }; /** @internal */ export const LinkedInvoiceItem$outboundSchema: z.ZodType< LinkedInvoiceItem$Outbound, z.ZodTypeDef, LinkedInvoiceItem > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), }) ); export function linkedInvoiceItemToJSON( linkedInvoiceItem: LinkedInvoiceItem, ): string { return JSON.stringify( LinkedInvoiceItem$outboundSchema.parse(linkedInvoiceItem), ); } export function linkedInvoiceItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedInvoiceItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedInvoiceItem' from JSON`, ); }