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