/* * 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 { WalletStatus, WalletStatus$inboundSchema, WalletStatus$outboundSchema, } from "./walletstatus.js"; export type PatchWallet = { name?: string | undefined; /** * Status of a wallet. * * @remarks * - `active`: The wallet is available for use and has an enabled payment method. * - `closed`: The wallet is no longer active and the corresponding payment method has been disabled. */ status?: WalletStatus | undefined; description?: string | undefined; /** * Free-form key-value pair list. Useful for storing information that is not captured elsewhere. */ metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const PatchWallet$inboundSchema: z.ZodType< PatchWallet, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), status: WalletStatus$inboundSchema.optional(), description: z.string().optional(), metadata: z.record(z.string()).optional(), }); /** @internal */ export type PatchWallet$Outbound = { name?: string | undefined; status?: string | undefined; description?: string | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const PatchWallet$outboundSchema: z.ZodType< PatchWallet$Outbound, z.ZodTypeDef, PatchWallet > = z.object({ name: z.string().optional(), status: WalletStatus$outboundSchema.optional(), description: z.string().optional(), metadata: z.record(z.string()).optional(), }); export function patchWalletToJSON(patchWallet: PatchWallet): string { return JSON.stringify(PatchWallet$outboundSchema.parse(patchWallet)); } export function patchWalletFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PatchWallet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchWallet' from JSON`, ); }