/* * 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 { Address, Address$inboundSchema, Address$Outbound, Address$outboundSchema, } from "./address.js"; import { EnrichedIndustryCodes, EnrichedIndustryCodes$inboundSchema, EnrichedIndustryCodes$Outbound, EnrichedIndustryCodes$outboundSchema, } from "./enrichedindustrycodes.js"; import { PhoneNumber, PhoneNumber$inboundSchema, PhoneNumber$Outbound, PhoneNumber$outboundSchema, } from "./phonenumber.js"; export type EnrichedBusinessProfile = { address?: Address | undefined; email?: string | undefined; industryCodes?: EnrichedIndustryCodes | undefined; legalBusinessName?: string | undefined; phone?: PhoneNumber | undefined; website?: string | undefined; }; /** @internal */ export const EnrichedBusinessProfile$inboundSchema: z.ZodType< EnrichedBusinessProfile, z.ZodTypeDef, unknown > = z.object({ address: Address$inboundSchema.optional(), email: z.string().optional(), industryCodes: EnrichedIndustryCodes$inboundSchema.optional(), legalBusinessName: z.string().optional(), phone: PhoneNumber$inboundSchema.optional(), website: z.string().optional(), }); /** @internal */ export type EnrichedBusinessProfile$Outbound = { address?: Address$Outbound | undefined; email?: string | undefined; industryCodes?: EnrichedIndustryCodes$Outbound | undefined; legalBusinessName?: string | undefined; phone?: PhoneNumber$Outbound | undefined; website?: string | undefined; }; /** @internal */ export const EnrichedBusinessProfile$outboundSchema: z.ZodType< EnrichedBusinessProfile$Outbound, z.ZodTypeDef, EnrichedBusinessProfile > = z.object({ address: Address$outboundSchema.optional(), email: z.string().optional(), industryCodes: EnrichedIndustryCodes$outboundSchema.optional(), legalBusinessName: z.string().optional(), phone: PhoneNumber$outboundSchema.optional(), website: z.string().optional(), }); export function enrichedBusinessProfileToJSON( enrichedBusinessProfile: EnrichedBusinessProfile, ): string { return JSON.stringify( EnrichedBusinessProfile$outboundSchema.parse(enrichedBusinessProfile), ); } export function enrichedBusinessProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EnrichedBusinessProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnrichedBusinessProfile' from JSON`, ); }