/* * 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 { AddressUpdate, AddressUpdate$inboundSchema, AddressUpdate$Outbound, AddressUpdate$outboundSchema, } from "./addressupdate.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 { TaxIDUpdate, TaxIDUpdate$inboundSchema, TaxIDUpdate$Outbound, TaxIDUpdate$outboundSchema, } from "./taxidupdate.js"; export type PatchBusiness = { legalBusinessName?: string | undefined; doingBusinessAs?: string | undefined; /** * The type of entity represented by this business. */ businessType?: BusinessType | undefined; address?: AddressUpdate | 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?: TaxIDUpdate | undefined; ownersProvided?: boolean | 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 PatchBusiness$inboundSchema: z.ZodType< PatchBusiness, z.ZodTypeDef, unknown > = z.object({ legalBusinessName: z.string().optional(), doingBusinessAs: z.string().optional(), businessType: BusinessType$inboundSchema.optional(), address: AddressUpdate$inboundSchema.optional(), phone: PhoneNumber$inboundSchema.optional(), email: z.string().optional(), website: z.string().optional(), description: z.string().optional(), taxID: TaxIDUpdate$inboundSchema.optional(), ownersProvided: z.boolean().optional(), industryCodes: IndustryCodes$inboundSchema.optional(), industry: z.string().optional(), primaryRegulator: PrimaryRegulator$inboundSchema.optional(), }); /** @internal */ export type PatchBusiness$Outbound = { legalBusinessName?: string | undefined; doingBusinessAs?: string | undefined; businessType?: string | undefined; address?: AddressUpdate$Outbound | undefined; phone?: PhoneNumber$Outbound | undefined; email?: string | undefined; website?: string | undefined; description?: string | undefined; taxID?: TaxIDUpdate$Outbound | undefined; ownersProvided?: boolean | undefined; industryCodes?: IndustryCodes$Outbound | undefined; industry?: string | undefined; primaryRegulator?: string | undefined; }; /** @internal */ export const PatchBusiness$outboundSchema: z.ZodType< PatchBusiness$Outbound, z.ZodTypeDef, PatchBusiness > = z.object({ legalBusinessName: z.string().optional(), doingBusinessAs: z.string().optional(), businessType: BusinessType$outboundSchema.optional(), address: AddressUpdate$outboundSchema.optional(), phone: PhoneNumber$outboundSchema.optional(), email: z.string().optional(), website: z.string().optional(), description: z.string().optional(), taxID: TaxIDUpdate$outboundSchema.optional(), ownersProvided: z.boolean().optional(), industryCodes: IndustryCodes$outboundSchema.optional(), industry: z.string().optional(), primaryRegulator: PrimaryRegulator$outboundSchema.optional(), }); export function patchBusinessToJSON(patchBusiness: PatchBusiness): string { return JSON.stringify(PatchBusiness$outboundSchema.parse(patchBusiness)); } export function patchBusinessFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PatchBusiness$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchBusiness' from JSON`, ); }