/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ContactsFilter = { /** * Name of the contact to filter on */ name?: string | undefined; /** * First name of the contact to filter on */ firstName?: string | undefined; /** * Last name of the contact to filter on */ lastName?: string | undefined; /** * Email of the contact to filter on */ email?: string | undefined; /** * Phone number of the contact to filter on */ phoneNumber?: string | undefined; /** * Unique identifier for the associated company of the contact to filter on */ companyId?: string | undefined; /** * Unique identifier for the owner of the contact to filter on */ ownerId?: string | undefined; }; /** @internal */ export const ContactsFilter$inboundSchema: z.ZodType< ContactsFilter, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), first_name: z.string().optional(), last_name: z.string().optional(), email: z.string().optional(), phone_number: z.string().optional(), company_id: z.string().optional(), owner_id: z.string().optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "phone_number": "phoneNumber", "company_id": "companyId", "owner_id": "ownerId", }); }); /** @internal */ export type ContactsFilter$Outbound = { name?: string | undefined; first_name?: string | undefined; last_name?: string | undefined; email?: string | undefined; phone_number?: string | undefined; company_id?: string | undefined; owner_id?: string | undefined; }; /** @internal */ export const ContactsFilter$outboundSchema: z.ZodType< ContactsFilter$Outbound, z.ZodTypeDef, ContactsFilter > = z.object({ name: z.string().optional(), firstName: z.string().optional(), lastName: z.string().optional(), email: z.string().optional(), phoneNumber: z.string().optional(), companyId: z.string().optional(), ownerId: z.string().optional(), }).transform((v) => { return remap$(v, { firstName: "first_name", lastName: "last_name", phoneNumber: "phone_number", companyId: "company_id", ownerId: "owner_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ContactsFilter$ { /** @deprecated use `ContactsFilter$inboundSchema` instead. */ export const inboundSchema = ContactsFilter$inboundSchema; /** @deprecated use `ContactsFilter$outboundSchema` instead. */ export const outboundSchema = ContactsFilter$outboundSchema; /** @deprecated use `ContactsFilter$Outbound` instead. */ export type Outbound = ContactsFilter$Outbound; } export function contactsFilterToJSON(contactsFilter: ContactsFilter): string { return JSON.stringify(ContactsFilter$outboundSchema.parse(contactsFilter)); } export function contactsFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ContactsFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContactsFilter' from JSON`, ); }