/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.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 > = z.object({ id: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), name: z.nullable(z.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 > = z.object({ id: z.nullable(z.string()).optional(), code: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LinkedInvoiceItem$ { /** @deprecated use `LinkedInvoiceItem$inboundSchema` instead. */ export const inboundSchema = LinkedInvoiceItem$inboundSchema; /** @deprecated use `LinkedInvoiceItem$outboundSchema` instead. */ export const outboundSchema = LinkedInvoiceItem$outboundSchema; /** @deprecated use `LinkedInvoiceItem$Outbound` instead. */ export type Outbound = LinkedInvoiceItem$Outbound; } 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`, ); }