/* * 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 { SendFundsAchError, SendFundsAchError$inboundSchema, SendFundsAchError$Outbound, SendFundsAchError$outboundSchema, } from "./sendfundsacherror.js"; import { SendFundsInstantBankError, SendFundsInstantBankError$inboundSchema, SendFundsInstantBankError$Outbound, SendFundsInstantBankError$outboundSchema, } from "./sendfundsinstantbankerror.js"; import { SendFundsPushToCardError, SendFundsPushToCardError$inboundSchema, SendFundsPushToCardError$Outbound, SendFundsPushToCardError$outboundSchema, } from "./sendfundspushtocarderror.js"; import { SendFundsRtpError, SendFundsRtpError$inboundSchema, SendFundsRtpError$Outbound, SendFundsRtpError$outboundSchema, } from "./sendfundsrtperror.js"; export type SendFundsError = { ach?: SendFundsAchError | undefined; pushToCard?: SendFundsPushToCardError | undefined; rtp?: SendFundsRtpError | undefined; instantBank?: SendFundsInstantBankError | undefined; }; /** @internal */ export const SendFundsError$inboundSchema: z.ZodType< SendFundsError, z.ZodTypeDef, unknown > = z.object({ ach: SendFundsAchError$inboundSchema.optional(), pushToCard: SendFundsPushToCardError$inboundSchema.optional(), rtp: SendFundsRtpError$inboundSchema.optional(), instantBank: SendFundsInstantBankError$inboundSchema.optional(), }); /** @internal */ export type SendFundsError$Outbound = { ach?: SendFundsAchError$Outbound | undefined; pushToCard?: SendFundsPushToCardError$Outbound | undefined; rtp?: SendFundsRtpError$Outbound | undefined; instantBank?: SendFundsInstantBankError$Outbound | undefined; }; /** @internal */ export const SendFundsError$outboundSchema: z.ZodType< SendFundsError$Outbound, z.ZodTypeDef, SendFundsError > = z.object({ ach: SendFundsAchError$outboundSchema.optional(), pushToCard: SendFundsPushToCardError$outboundSchema.optional(), rtp: SendFundsRtpError$outboundSchema.optional(), instantBank: SendFundsInstantBankError$outboundSchema.optional(), }); export function sendFundsErrorToJSON(sendFundsError: SendFundsError): string { return JSON.stringify(SendFundsError$outboundSchema.parse(sendFundsError)); } export function sendFundsErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SendFundsError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SendFundsError' from JSON`, ); }