/* * 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"; /** * Status of customer to filter on */ export const CustomersFilterStatus = { Active: "active", Inactive: "inactive", Archived: "archived", All: "all", } as const; /** * Status of customer to filter on */ export type CustomersFilterStatus = OpenEnum; export type CustomersFilter = { /** * Comma-separated list of customer IDs to filter by (e.g. `12345,67890`). */ ids?: string | undefined; /** * Company Name of customer to search for */ companyName?: string | undefined; /** * Display Name of customer to search for */ displayName?: string | undefined; /** * First name of customer to search for */ firstName?: string | undefined; /** * Last name of customer to search for */ lastName?: string | undefined; /** * Email of customer to search for */ email?: string | undefined; /** * Status of customer to filter on */ status?: CustomersFilterStatus | null | undefined; updatedSince?: Date | undefined; /** * Supplier ID of customer to search for */ supplierId?: string | undefined; /** * Filter by the subsidiary (legal entity) the customer's primary subsidiary belongs to. Only honored on connectors that support multi-entity scoping (e.g. NetSuite OneWorld); ignored elsewhere. */ subsidiaryId?: string | undefined; }; /** @internal */ export const CustomersFilterStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, CustomersFilterStatus > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(CustomersFilterStatus) ); /** @internal */ export type CustomersFilter$Outbound = { ids?: string | undefined; company_name?: string | undefined; display_name?: string | undefined; first_name?: string | undefined; last_name?: string | undefined; email?: string | undefined; status?: string | null | undefined; updated_since?: string | undefined; supplier_id?: string | undefined; subsidiary_id?: string | undefined; }; /** @internal */ export const CustomersFilter$outboundSchema: z.ZodType< CustomersFilter$Outbound, z.ZodTypeDef, CustomersFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ ids: z.string().optional(), companyName: z.string().optional(), displayName: z.string().optional(), firstName: z.string().optional(), lastName: z.string().optional(), email: z.string().optional(), status: z.nullable(CustomersFilterStatus$outboundSchema).optional(), updatedSince: z.date().transform(v => v.toISOString()).optional(), supplierId: z.string().optional(), subsidiaryId: z.string().optional(), }).transform((v) => { return remap$(v, { companyName: "company_name", displayName: "display_name", firstName: "first_name", lastName: "last_name", updatedSince: "updated_since", supplierId: "supplier_id", subsidiaryId: "subsidiary_id", }); }) ); export function customersFilterToJSON( customersFilter: CustomersFilter, ): string { return JSON.stringify(CustomersFilter$outboundSchema.parse(customersFilter)); }