/* * 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 { AchPaymentMethod, AchPaymentMethod$inboundSchema, } from "./achpaymentmethod.js"; import { CardPaymentMethod, CardPaymentMethod$inboundSchema, } from "./cardpaymentmethod.js"; import { LinkPaymentMethod, LinkPaymentMethod$inboundSchema, } from "./linkpaymentmethod.js"; /** * Make all properties in T optional */ export type PaymentMethod = { card?: CardPaymentMethod | undefined; ach?: AchPaymentMethod | undefined; link?: LinkPaymentMethod | undefined; }; /** @internal */ export const PaymentMethod$inboundSchema: z.ZodType< PaymentMethod, z.ZodTypeDef, unknown > = z.object({ card: CardPaymentMethod$inboundSchema.optional(), ach: AchPaymentMethod$inboundSchema.optional(), link: LinkPaymentMethod$inboundSchema.optional(), }); export function paymentMethodFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentMethod$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentMethod' from JSON`, ); }