/* * 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 { CreateBusinessProfile, CreateBusinessProfile$inboundSchema, CreateBusinessProfile$Outbound, CreateBusinessProfile$outboundSchema, } from "./createbusinessprofile.js"; import { CreateIndividualProfile, CreateIndividualProfile$inboundSchema, CreateIndividualProfile$Outbound, CreateIndividualProfile$outboundSchema, } from "./createindividualprofile.js"; export type CreateProfile = { individual?: CreateIndividualProfile | undefined; business?: CreateBusinessProfile | undefined; }; /** @internal */ export const CreateProfile$inboundSchema: z.ZodType< CreateProfile, z.ZodTypeDef, unknown > = z.object({ individual: CreateIndividualProfile$inboundSchema.optional(), business: CreateBusinessProfile$inboundSchema.optional(), }); /** @internal */ export type CreateProfile$Outbound = { individual?: CreateIndividualProfile$Outbound | undefined; business?: CreateBusinessProfile$Outbound | undefined; }; /** @internal */ export const CreateProfile$outboundSchema: z.ZodType< CreateProfile$Outbound, z.ZodTypeDef, CreateProfile > = z.object({ individual: CreateIndividualProfile$outboundSchema.optional(), business: CreateBusinessProfile$outboundSchema.optional(), }); export function createProfileToJSON(createProfile: CreateProfile): string { return JSON.stringify(CreateProfile$outboundSchema.parse(createProfile)); } export function createProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateProfile' from JSON`, ); }