/* * 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 InvoiceItemType = { 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 InvoiceItemType = OpenEnum; /** * The kind of transaction, indicating whether it is a sales transaction or a purchase transaction. */ export const TransactionType = { Sale: "sale", Purchase: "purchase", } as const; /** * The kind of transaction, indicating whether it is a sales transaction or a purchase transaction. */ export type TransactionType = OpenEnum; export type InvoiceItemsFilter = { updatedSince?: Date | undefined; /** * Comma-separated list of invoice item IDs to filter by (e.g. `12345,67890`). */ ids?: string | undefined; /** * Name of Invoice Items to search for */ name?: string | undefined; /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ type?: InvoiceItemType | null | undefined; /** * The kind of transaction, indicating whether it is a sales transaction or a purchase transaction. */ transactionType?: TransactionType | null | undefined; /** * Filter by the subsidiary (legal entity) the record belongs to. Only honored on connectors that support multi-entity scoping (e.g. NetSuite OneWorld); ignored elsewhere. */ subsidiaryId?: string | undefined; }; /** @internal */ export const InvoiceItemType$outboundSchema: z.ZodType< string, z.ZodTypeDef, InvoiceItemType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(InvoiceItemType) ); /** @internal */ export const TransactionType$outboundSchema: z.ZodType< string, z.ZodTypeDef, TransactionType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(TransactionType) ); /** @internal */ export type InvoiceItemsFilter$Outbound = { updated_since?: string | undefined; ids?: string | undefined; name?: string | undefined; type?: string | null | undefined; transaction_type?: string | null | undefined; subsidiary_id?: string | undefined; }; /** @internal */ export const InvoiceItemsFilter$outboundSchema: z.ZodType< InvoiceItemsFilter$Outbound, z.ZodTypeDef, InvoiceItemsFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ updatedSince: z.date().transform(v => v.toISOString()).optional(), ids: z.string().optional(), name: z.string().optional(), type: z.nullable(InvoiceItemType$outboundSchema).optional(), transactionType: z.nullable(TransactionType$outboundSchema).optional(), subsidiaryId: z.string().optional(), }).transform((v) => { return remap$(v, { updatedSince: "updated_since", transactionType: "transaction_type", subsidiaryId: "subsidiary_id", }); }) ); export function invoiceItemsFilterToJSON( invoiceItemsFilter: InvoiceItemsFilter, ): string { return JSON.stringify( InvoiceItemsFilter$outboundSchema.parse(invoiceItemsFilter), ); }