/* * 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"; import { CreateBusinessError, CreateBusinessError$inboundSchema, CreateBusinessError$Outbound, CreateBusinessError$outboundSchema, } from "./createbusinesserror.js"; import { CreateIndividualError, CreateIndividualError$inboundSchema, CreateIndividualError$Outbound, CreateIndividualError$outboundSchema, } from "./createindividualerror.js"; export type CreateProfileError = { individual?: CreateIndividualError | undefined; business?: CreateBusinessError | undefined; }; /** @internal */ export const CreateProfileError$inboundSchema: z.ZodType< CreateProfileError, z.ZodTypeDef, unknown > = z.object({ individual: CreateIndividualError$inboundSchema.optional(), business: CreateBusinessError$inboundSchema.optional(), }); /** @internal */ export type CreateProfileError$Outbound = { individual?: CreateIndividualError$Outbound | undefined; business?: CreateBusinessError$Outbound | undefined; }; /** @internal */ export const CreateProfileError$outboundSchema: z.ZodType< CreateProfileError$Outbound, z.ZodTypeDef, CreateProfileError > = z.object({ individual: CreateIndividualError$outboundSchema.optional(), business: CreateBusinessError$outboundSchema.optional(), }); export function createProfileErrorToJSON( createProfileError: CreateProfileError, ): string { return JSON.stringify( CreateProfileError$outboundSchema.parse(createProfileError), ); } export function createProfileErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateProfileError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateProfileError' from JSON`, ); }