/* * 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 { CollectFundsAch, CollectFundsAch$inboundSchema, CollectFundsAch$Outbound, CollectFundsAch$outboundSchema, } from "./collectfundsach.js"; import { CollectFundsCardPayments, CollectFundsCardPayments$inboundSchema, CollectFundsCardPayments$Outbound, CollectFundsCardPayments$outboundSchema, } from "./collectfundscardpayments.js"; export type CollectFunds = { ach?: CollectFundsAch | undefined; cardPayments?: CollectFundsCardPayments | undefined; }; /** @internal */ export const CollectFunds$inboundSchema: z.ZodType< CollectFunds, z.ZodTypeDef, unknown > = z.object({ ach: CollectFundsAch$inboundSchema.optional(), cardPayments: CollectFundsCardPayments$inboundSchema.optional(), }); /** @internal */ export type CollectFunds$Outbound = { ach?: CollectFundsAch$Outbound | undefined; cardPayments?: CollectFundsCardPayments$Outbound | undefined; }; /** @internal */ export const CollectFunds$outboundSchema: z.ZodType< CollectFunds$Outbound, z.ZodTypeDef, CollectFunds > = z.object({ ach: CollectFundsAch$outboundSchema.optional(), cardPayments: CollectFundsCardPayments$outboundSchema.optional(), }); export function collectFundsToJSON(collectFunds: CollectFunds): string { return JSON.stringify(CollectFunds$outboundSchema.parse(collectFunds)); } export function collectFundsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectFunds$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectFunds' from JSON`, ); }