/* * 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 InvoiceItemsFilter = { /** * Name of Invoice Items to search for */ name?: string | undefined; }; /** @internal */ export const InvoiceItemsFilter$inboundSchema: z.ZodType< InvoiceItemsFilter, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), }); /** @internal */ export type InvoiceItemsFilter$Outbound = { name?: string | undefined; }; /** @internal */ export const InvoiceItemsFilter$outboundSchema: z.ZodType< InvoiceItemsFilter$Outbound, z.ZodTypeDef, InvoiceItemsFilter > = z.object({ name: 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 InvoiceItemsFilter$ { /** @deprecated use `InvoiceItemsFilter$inboundSchema` instead. */ export const inboundSchema = InvoiceItemsFilter$inboundSchema; /** @deprecated use `InvoiceItemsFilter$outboundSchema` instead. */ export const outboundSchema = InvoiceItemsFilter$outboundSchema; /** @deprecated use `InvoiceItemsFilter$Outbound` instead. */ export type Outbound = InvoiceItemsFilter$Outbound; } export function invoiceItemsFilterToJSON( invoiceItemsFilter: InvoiceItemsFilter, ): string { return JSON.stringify( InvoiceItemsFilter$outboundSchema.parse(invoiceItemsFilter), ); } export function invoiceItemsFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InvoiceItemsFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InvoiceItemsFilter' from JSON`, ); }