/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { smartUnion } from "../../types/smartUnion.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CardPayment, CardPayment$inboundSchema } from "./cardpayment.js"; import { GenericPayment, GenericPayment$inboundSchema, } from "./genericpayment.js"; export type Payment = CardPayment | GenericPayment; /** @internal */ export const Payment$inboundSchema: z.ZodMiniType = smartUnion([CardPayment$inboundSchema, GenericPayment$inboundSchema]); export function paymentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Payment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Payment' from JSON`, ); }