/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 64981d13afb8 */ 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 PersonObject = { /** * The display name. */ name: string; /** * An opaque identifier that can be used to request metadata for a Person. */ obfuscatedId: string; }; /** @internal */ export const PersonObject$inboundSchema: z.ZodType< PersonObject, z.ZodTypeDef, unknown > = z.object({ name: z.string(), obfuscatedId: z.string(), }); /** @internal */ export type PersonObject$Outbound = { name: string; obfuscatedId: string; }; /** @internal */ export const PersonObject$outboundSchema: z.ZodType< PersonObject$Outbound, z.ZodTypeDef, PersonObject > = z.object({ name: z.string(), obfuscatedId: z.string(), }); export function personObjectToJSON(personObject: PersonObject): string { return JSON.stringify(PersonObject$outboundSchema.parse(personObject)); } export function personObjectFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PersonObject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PersonObject' from JSON`, ); }