/* * 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 { BusinessType, BusinessType$inboundSchema, BusinessType$outboundSchema, } from "./businesstype.js"; import { IndustryCodes, IndustryCodes$inboundSchema, IndustryCodes$Outbound, IndustryCodes$outboundSchema, } from "./industrycodes.js"; import { PhoneNumber, PhoneNumber$inboundSchema, PhoneNumber$Outbound, PhoneNumber$outboundSchema, } from "./phonenumber.js"; import { PrimaryRegulator, PrimaryRegulator$inboundSchema, PrimaryRegulator$outboundSchema, } from "./primaryregulator.js"; import { TaxID, TaxID$inboundSchema, TaxID$Outbound, TaxID$outboundSchema, } from "./taxid.js"; export type CreateBusinessProfile = { /** * The legal name under which the entity is registered. */ legalBusinessName: string; /** * A registered trade name under which the business operates, if different from its legal name. */ doingBusinessAs?: string | undefined; /** * The type of entity represented by this business. */ businessType?: BusinessType | undefined; address?: Address | undefined; phone?: PhoneNumber | undefined; email?: string | undefined; website?: string | undefined; description?: string | undefined; /** * An EIN (employer identification number) for the business. For sole proprietors, an SSN can be used as the EIN. */ taxID?: TaxID | undefined; industryCodes?: IndustryCodes | undefined; /** * Classification identifier for the industry. Use the [GET industries](https://docs.moov.io/api/enrichment/form-shortening/industries/get/) endpoint to retrieve an array of valid industry details for a merchant, inducing all industry field values. */ industry?: string | undefined; /** * If the business is a financial institution, this field describes its primary regulator. */ primaryRegulator?: PrimaryRegulator | undefined; }; /** @internal */ export const CreateBusinessProfile$inboundSchema: z.ZodType< CreateBusinessProfile, z.ZodTypeDef, unknown > = z.object({ legalBusinessName: z.string(), doingBusinessAs: z.string().optional(), businessType: BusinessType$inboundSchema.optional(), address: Address$inboundSchema.optional(), phone: PhoneNumber$inboundSchema.optional(), email: z.string().optional(), website: z.string().optional(), description: z.string().optional(), taxID: TaxID$inboundSchema.optional(), industryCodes: IndustryCodes$inboundSchema.optional(), industry: z.string().optional(), primaryRegulator: PrimaryRegulator$inboundSchema.optional(), }); /** @internal */ export type CreateBusinessProfile$Outbound = { legalBusinessName: string; doingBusinessAs?: string | undefined; businessType?: string | undefined; address?: Address$Outbound | undefined; phone?: PhoneNumber$Outbound | undefined; email?: string | undefined; website?: string | undefined; description?: string | undefined; taxID?: TaxID$Outbound | undefined; industryCodes?: IndustryCodes$Outbound | undefined; industry?: string | undefined; primaryRegulator?: string | undefined; }; /** @internal */ export const CreateBusinessProfile$outboundSchema: z.ZodType< CreateBusinessProfile$Outbound, z.ZodTypeDef, CreateBusinessProfile > = z.object({ legalBusinessName: z.string(), doingBusinessAs: z.string().optional(), businessType: BusinessType$outboundSchema.optional(), address: Address$outboundSchema.optional(), phone: PhoneNumber$outboundSchema.optional(), email: z.string().optional(), website: z.string().optional(), description: z.string().optional(), taxID: TaxID$outboundSchema.optional(), industryCodes: IndustryCodes$outboundSchema.optional(), industry: z.string().optional(), primaryRegulator: PrimaryRegulator$outboundSchema.optional(), }); export function createBusinessProfileToJSON( createBusinessProfile: CreateBusinessProfile, ): string { return JSON.stringify( CreateBusinessProfile$outboundSchema.parse(createBusinessProfile), ); } export function createBusinessProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateBusinessProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateBusinessProfile' from JSON`, ); }