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