/* * 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 { ApplePayResponse, ApplePayResponse$inboundSchema, ApplePayResponse$Outbound, ApplePayResponse$outboundSchema, } from "./applepayresponse.js"; import { PaymentMethodType, PaymentMethodType$inboundSchema, PaymentMethodType$outboundSchema, } from "./paymentmethodtype.js"; export type LinkedApplePayPaymentMethod = { /** * The new payment method's ID. */ paymentMethodID: string; /** * The payment method type that represents a payment rail and directionality */ paymentMethodType: PaymentMethodType; /** * Describes an Apple Pay token on a Moov account. */ applePay: ApplePayResponse; }; /** @internal */ export const LinkedApplePayPaymentMethod$inboundSchema: z.ZodType< LinkedApplePayPaymentMethod, z.ZodTypeDef, unknown > = z.object({ paymentMethodID: z.string(), paymentMethodType: PaymentMethodType$inboundSchema, applePay: ApplePayResponse$inboundSchema, }); /** @internal */ export type LinkedApplePayPaymentMethod$Outbound = { paymentMethodID: string; paymentMethodType: string; applePay: ApplePayResponse$Outbound; }; /** @internal */ export const LinkedApplePayPaymentMethod$outboundSchema: z.ZodType< LinkedApplePayPaymentMethod$Outbound, z.ZodTypeDef, LinkedApplePayPaymentMethod > = z.object({ paymentMethodID: z.string(), paymentMethodType: PaymentMethodType$outboundSchema, applePay: ApplePayResponse$outboundSchema, }); export function linkedApplePayPaymentMethodToJSON( linkedApplePayPaymentMethod: LinkedApplePayPaymentMethod, ): string { return JSON.stringify( LinkedApplePayPaymentMethod$outboundSchema.parse( linkedApplePayPaymentMethod, ), ); } export function linkedApplePayPaymentMethodFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedApplePayPaymentMethod$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedApplePayPaymentMethod' from JSON`, ); }