/* * 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 { WalletType, WalletType$inboundSchema, WalletType$outboundSchema, } from "./wallettype.js"; export type PaymentMethodsWallet = { walletID: string; partnerAccountID: string; /** * Type of a wallet. * * @remarks * - `default`: The system-generated wallet automatically created when an account is granted the wallet capability. * - `general`: An additional, user-defined wallet created via API or Dashboard. */ walletType: WalletType; }; /** @internal */ export const PaymentMethodsWallet$inboundSchema: z.ZodType< PaymentMethodsWallet, z.ZodTypeDef, unknown > = z.object({ walletID: z.string(), partnerAccountID: z.string(), walletType: WalletType$inboundSchema, }); /** @internal */ export type PaymentMethodsWallet$Outbound = { walletID: string; partnerAccountID: string; walletType: string; }; /** @internal */ export const PaymentMethodsWallet$outboundSchema: z.ZodType< PaymentMethodsWallet$Outbound, z.ZodTypeDef, PaymentMethodsWallet > = z.object({ walletID: z.string(), partnerAccountID: z.string(), walletType: WalletType$outboundSchema, }); export function paymentMethodsWalletToJSON( paymentMethodsWallet: PaymentMethodsWallet, ): string { return JSON.stringify( PaymentMethodsWallet$outboundSchema.parse(paymentMethodsWallet), ); } export function paymentMethodsWalletFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentMethodsWallet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentMethodsWallet' from JSON`, ); }