/* * 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 ACHException = { code?: string | undefined; reason?: string | undefined; description?: string | undefined; }; /** @internal */ export const ACHException$inboundSchema: z.ZodType< ACHException, z.ZodTypeDef, unknown > = z.object({ code: z.string().optional(), reason: z.string().optional(), description: z.string().optional(), }); /** @internal */ export type ACHException$Outbound = { code?: string | undefined; reason?: string | undefined; description?: string | undefined; }; /** @internal */ export const ACHException$outboundSchema: z.ZodType< ACHException$Outbound, z.ZodTypeDef, ACHException > = z.object({ code: z.string().optional(), reason: z.string().optional(), description: z.string().optional(), }); export function achExceptionToJSON(achException: ACHException): string { return JSON.stringify(ACHException$outboundSchema.parse(achException)); } export function achExceptionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ACHException$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ACHException' from JSON`, ); }