/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CustomerRequestEntity = { /** * Unique identifier of the customer. You may specify only one of these parameters: id or email. */ id?: string | undefined; /** * Customer email address. You may only specify one of these parameters: id, email. */ email?: string | undefined; }; /** @internal */ export const CustomerRequestEntity$inboundSchema: z.ZodType< CustomerRequestEntity, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), email: z.string().optional(), }); /** @internal */ export type CustomerRequestEntity$Outbound = { id?: string | undefined; email?: string | undefined; }; /** @internal */ export const CustomerRequestEntity$outboundSchema: z.ZodType< CustomerRequestEntity$Outbound, z.ZodTypeDef, CustomerRequestEntity > = z.object({ id: z.string().optional(), email: z.string().optional(), }); export function customerRequestEntityToJSON( customerRequestEntity: CustomerRequestEntity, ): string { return JSON.stringify( CustomerRequestEntity$outboundSchema.parse(customerRequestEntity), ); } export function customerRequestEntityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomerRequestEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomerRequestEntity' from JSON`, ); }