/* * 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 { CardBrand, CardBrand$inboundSchema } from "./cardbrand.js"; export type CardPaymentMethod = { last4: string; brand: CardBrand; }; /** @internal */ export const CardPaymentMethod$inboundSchema: z.ZodType< CardPaymentMethod, z.ZodTypeDef, unknown > = z.object({ last4: z.string(), brand: CardBrand$inboundSchema, }); export function cardPaymentMethodFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CardPaymentMethod$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CardPaymentMethod' from JSON`, ); }