/* * 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"; /** * The customer this entity is linked to. */ export type LinkedCustomerInput = { /** * The ID of the customer this entity is linked to. */ id?: string | undefined; /** * The display name of the customer. */ displayName?: string | null | undefined; /** * The name of the customer. Deprecated, use display_name instead. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ name?: string | undefined; /** * The email address of the customer. */ email?: string | undefined; }; /** @internal */ export const LinkedCustomerInput$inboundSchema: z.ZodType< LinkedCustomerInput, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), display_name: z.nullable(z.string()).optional(), name: z.string().optional(), email: z.string().optional(), }).transform((v) => { return remap$(v, { "display_name": "displayName", }); }); /** @internal */ export type LinkedCustomerInput$Outbound = { id?: string | undefined; display_name?: string | null | undefined; name?: string | undefined; email?: string | undefined; }; /** @internal */ export const LinkedCustomerInput$outboundSchema: z.ZodType< LinkedCustomerInput$Outbound, z.ZodTypeDef, LinkedCustomerInput > = z.object({ id: z.string().optional(), displayName: z.nullable(z.string()).optional(), name: z.string().optional(), email: z.string().optional(), }).transform((v) => { return remap$(v, { displayName: "display_name", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LinkedCustomerInput$ { /** @deprecated use `LinkedCustomerInput$inboundSchema` instead. */ export const inboundSchema = LinkedCustomerInput$inboundSchema; /** @deprecated use `LinkedCustomerInput$outboundSchema` instead. */ export const outboundSchema = LinkedCustomerInput$outboundSchema; /** @deprecated use `LinkedCustomerInput$Outbound` instead. */ export type Outbound = LinkedCustomerInput$Outbound; } export function linkedCustomerInputToJSON( linkedCustomerInput: LinkedCustomerInput, ): string { return JSON.stringify( LinkedCustomerInput$outboundSchema.parse(linkedCustomerInput), ); } export function linkedCustomerInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedCustomerInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedCustomerInput' from JSON`, ); }