/* * 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"; export type TaxIDUpdateEin = { number?: string | undefined; }; /** * An EIN (employer identification number) for the business. For sole proprietors, an SSN can be used as the EIN. */ export type TaxIDUpdate = { ein?: TaxIDUpdateEin | undefined; }; /** @internal */ export const TaxIDUpdateEin$inboundSchema: z.ZodType< TaxIDUpdateEin, z.ZodTypeDef, unknown > = z.object({ number: z.string().optional(), }); /** @internal */ export type TaxIDUpdateEin$Outbound = { number?: string | undefined; }; /** @internal */ export const TaxIDUpdateEin$outboundSchema: z.ZodType< TaxIDUpdateEin$Outbound, z.ZodTypeDef, TaxIDUpdateEin > = z.object({ number: z.string().optional(), }); export function taxIDUpdateEinToJSON(taxIDUpdateEin: TaxIDUpdateEin): string { return JSON.stringify(TaxIDUpdateEin$outboundSchema.parse(taxIDUpdateEin)); } export function taxIDUpdateEinFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxIDUpdateEin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxIDUpdateEin' from JSON`, ); } /** @internal */ export const TaxIDUpdate$inboundSchema: z.ZodType< TaxIDUpdate, z.ZodTypeDef, unknown > = z.object({ ein: z.lazy(() => TaxIDUpdateEin$inboundSchema).optional(), }); /** @internal */ export type TaxIDUpdate$Outbound = { ein?: TaxIDUpdateEin$Outbound | undefined; }; /** @internal */ export const TaxIDUpdate$outboundSchema: z.ZodType< TaxIDUpdate$Outbound, z.ZodTypeDef, TaxIDUpdate > = z.object({ ein: z.lazy(() => TaxIDUpdateEin$outboundSchema).optional(), }); export function taxIDUpdateToJSON(taxIDUpdate: TaxIDUpdate): string { return JSON.stringify(TaxIDUpdate$outboundSchema.parse(taxIDUpdate)); } export function taxIDUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TaxIDUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaxIDUpdate' from JSON`, ); }