/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { BusinessAddress, BusinessAddress$inboundSchema, BusinessAddress$Outbound, BusinessAddress$outboundSchema, } from "./businessaddress.js"; import { RegistrationFiling, RegistrationFiling$inboundSchema, RegistrationFiling$Outbound, RegistrationFiling$outboundSchema, } from "./registrationfiling.js"; import { RelatedPerson, RelatedPerson$inboundSchema, RelatedPerson$Outbound, RelatedPerson$outboundSchema, } from "./relatedperson.js"; export type Business = { businessAddress?: BusinessAddress | undefined; businessName?: string | undefined; registrationFiling?: RegistrationFiling | undefined; relatedPersons?: Array | undefined; taxId?: string | undefined; tradeName?: string | undefined; }; /** @internal */ export const Business$inboundSchema: z.ZodType< Business, z.ZodTypeDef, unknown > = z.object({ businessAddress: BusinessAddress$inboundSchema.optional(), businessName: z.string().optional(), registrationFiling: RegistrationFiling$inboundSchema.optional(), relatedPersons: z.array(RelatedPerson$inboundSchema).optional(), taxId: z.string().optional(), tradeName: z.string().optional(), }); /** @internal */ export type Business$Outbound = { businessAddress?: BusinessAddress$Outbound | undefined; businessName?: string | undefined; registrationFiling?: RegistrationFiling$Outbound | undefined; relatedPersons?: Array | undefined; taxId?: string | undefined; tradeName?: string | undefined; }; /** @internal */ export const Business$outboundSchema: z.ZodType< Business$Outbound, z.ZodTypeDef, Business > = z.object({ businessAddress: BusinessAddress$outboundSchema.optional(), businessName: z.string().optional(), registrationFiling: RegistrationFiling$outboundSchema.optional(), relatedPersons: z.array(RelatedPerson$outboundSchema).optional(), taxId: z.string().optional(), tradeName: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Business$ { /** @deprecated use `Business$inboundSchema` instead. */ export const inboundSchema = Business$inboundSchema; /** @deprecated use `Business$outboundSchema` instead. */ export const outboundSchema = Business$outboundSchema; /** @deprecated use `Business$Outbound` instead. */ export type Outbound = Business$Outbound; } export function businessToJSON(business: Business): string { return JSON.stringify(Business$outboundSchema.parse(business)); } export function businessFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Business$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Business' from JSON`, ); }