/* * 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 { PaymentMethodsBankAccount, PaymentMethodsBankAccount$inboundSchema, PaymentMethodsBankAccount$Outbound, PaymentMethodsBankAccount$outboundSchema, } from "./paymentmethodsbankaccount.js"; export type AchDebitFundPaymentMethod = { /** * ID of the payment method. */ paymentMethodID: string; paymentMethodType: "ach-debit-fund"; /** * A bank account as contained within a payment method. */ bankAccount: PaymentMethodsBankAccount; }; /** @internal */ export const AchDebitFundPaymentMethod$inboundSchema: z.ZodType< AchDebitFundPaymentMethod, z.ZodTypeDef, unknown > = z.object({ paymentMethodID: z.string(), paymentMethodType: z.literal("ach-debit-fund"), bankAccount: PaymentMethodsBankAccount$inboundSchema, }); /** @internal */ export type AchDebitFundPaymentMethod$Outbound = { paymentMethodID: string; paymentMethodType: "ach-debit-fund"; bankAccount: PaymentMethodsBankAccount$Outbound; }; /** @internal */ export const AchDebitFundPaymentMethod$outboundSchema: z.ZodType< AchDebitFundPaymentMethod$Outbound, z.ZodTypeDef, AchDebitFundPaymentMethod > = z.object({ paymentMethodID: z.string(), paymentMethodType: z.literal("ach-debit-fund"), bankAccount: PaymentMethodsBankAccount$outboundSchema, }); export function achDebitFundPaymentMethodToJSON( achDebitFundPaymentMethod: AchDebitFundPaymentMethod, ): string { return JSON.stringify( AchDebitFundPaymentMethod$outboundSchema.parse(achDebitFundPaymentMethod), ); } export function achDebitFundPaymentMethodFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchDebitFundPaymentMethod$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchDebitFundPaymentMethod' from JSON`, ); }