/* * 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 { EnrichedBusinessProfile, EnrichedBusinessProfile$inboundSchema, EnrichedBusinessProfile$Outbound, EnrichedBusinessProfile$outboundSchema, } from "./enrichedbusinessprofile.js"; export type EnrichedBusinessResponse = { business?: EnrichedBusinessProfile | undefined; }; /** @internal */ export const EnrichedBusinessResponse$inboundSchema: z.ZodType< EnrichedBusinessResponse, z.ZodTypeDef, unknown > = z.object({ business: EnrichedBusinessProfile$inboundSchema.optional(), }); /** @internal */ export type EnrichedBusinessResponse$Outbound = { business?: EnrichedBusinessProfile$Outbound | undefined; }; /** @internal */ export const EnrichedBusinessResponse$outboundSchema: z.ZodType< EnrichedBusinessResponse$Outbound, z.ZodTypeDef, EnrichedBusinessResponse > = z.object({ business: EnrichedBusinessProfile$outboundSchema.optional(), }); export function enrichedBusinessResponseToJSON( enrichedBusinessResponse: EnrichedBusinessResponse, ): string { return JSON.stringify( EnrichedBusinessResponse$outboundSchema.parse(enrichedBusinessResponse), ); } export function enrichedBusinessResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EnrichedBusinessResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnrichedBusinessResponse' from JSON`, ); }