/* * 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$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Email, Email$inboundSchema } from "./email.js"; import { PhoneNumber, PhoneNumber$inboundSchema } from "./phonenumber.js"; /** * The customer this entity is linked to. */ export type LinkedEcommerceCustomer = { /** * The ID of the customer this entity is linked to. */ id?: string | null | undefined; /** * Full name of the customer */ name?: string | null | undefined; /** * First name of the customer */ firstName?: string | null | undefined; /** * Last name of the customer */ lastName?: string | null | undefined; /** * Company name of the customer */ companyName?: string | null | undefined; phoneNumbers?: Array | null | undefined; emails?: Array | null | undefined; }; /** @internal */ export const LinkedEcommerceCustomer$inboundSchema: z.ZodType< LinkedEcommerceCustomer, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(types.string()).optional(), name: z.nullable(types.string()).optional(), first_name: z.nullable(types.string()).optional(), last_name: z.nullable(types.string()).optional(), company_name: z.nullable(types.string()).optional(), phone_numbers: z.nullable(z.array(PhoneNumber$inboundSchema)).optional(), emails: z.nullable(z.array(Email$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "company_name": "companyName", "phone_numbers": "phoneNumbers", }); }) ); export function linkedEcommerceCustomerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedEcommerceCustomer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedEcommerceCustomer' from JSON`, ); }