/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$ } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ export const InvoiceItemFilterInvoiceItemType = { Inventory: "inventory", Service: "service", Other: "other", } as const; /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ export type InvoiceItemFilterInvoiceItemType = OpenEnum< typeof InvoiceItemFilterInvoiceItemType >; /** * The kind of transaction, indicating whether it is a sales transaction or a purchase transaction. */ export const InvoiceItemFilterTransactionType = { Sale: "sale", Purchase: "purchase", } as const; /** * The kind of transaction, indicating whether it is a sales transaction or a purchase transaction. */ export type InvoiceItemFilterTransactionType = OpenEnum< typeof InvoiceItemFilterTransactionType >; export type InvoiceItemFilter = { /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ type?: InvoiceItemFilterInvoiceItemType | null | undefined; /** * The kind of transaction, indicating whether it is a sales transaction or a purchase transaction. */ transactionType?: InvoiceItemFilterTransactionType | null | undefined; }; /** @internal */ export const InvoiceItemFilterInvoiceItemType$outboundSchema: z.ZodType< string, z.ZodTypeDef, InvoiceItemFilterInvoiceItemType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(InvoiceItemFilterInvoiceItemType) ); /** @internal */ export const InvoiceItemFilterTransactionType$outboundSchema: z.ZodType< string, z.ZodTypeDef, InvoiceItemFilterTransactionType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(InvoiceItemFilterTransactionType) ); /** @internal */ export type InvoiceItemFilter$Outbound = { type?: string | null | undefined; transaction_type?: string | null | undefined; }; /** @internal */ export const InvoiceItemFilter$outboundSchema: z.ZodType< InvoiceItemFilter$Outbound, z.ZodTypeDef, InvoiceItemFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ type: z.nullable(InvoiceItemFilterInvoiceItemType$outboundSchema) .optional(), transactionType: z.nullable(InvoiceItemFilterTransactionType$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { transactionType: "transaction_type", }); }) ); export function invoiceItemFilterToJSON( invoiceItemFilter: InvoiceItemFilter, ): string { return JSON.stringify( InvoiceItemFilter$outboundSchema.parse(invoiceItemFilter), ); }