/* * 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"; /** * The customer this entity is linked to. */ export type LinkedCustomer = { /** * The ID of the customer this entity is linked to. */ id?: string | undefined; /** * The display ID of the customer. */ displayId?: string | null | undefined; /** * The display name of the customer. */ displayName?: string | null | undefined; /** * The name of the customer. Deprecated, use display_name instead. * * @deprecated field: Deprecated. Use display_name instead.. */ name?: string | undefined; /** * The company name of the customer. */ companyName?: string | null | undefined; /** * The email address of the customer. */ email?: string | undefined; }; /** @internal */ export const LinkedCustomer$inboundSchema: z.ZodType< LinkedCustomer, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), display_id: z.nullable(types.string()).optional(), display_name: z.nullable(types.string()).optional(), name: types.optional(types.string()), company_name: z.nullable(types.string()).optional(), email: types.optional(types.string()), }).transform((v) => { return remap$(v, { "display_id": "displayId", "display_name": "displayName", "company_name": "companyName", }); }) ); export function linkedCustomerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedCustomer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedCustomer' from JSON`, ); }