/* * 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 WebhookDataWalletUpdated = { accountID: string; walletID: string; /** * 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; }; /** @internal */ export const WebhookDataWalletUpdated$inboundSchema: z.ZodType< WebhookDataWalletUpdated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), walletID: z.string(), status: WalletStatus$inboundSchema, }); /** @internal */ export type WebhookDataWalletUpdated$Outbound = { accountID: string; walletID: string; status: string; }; /** @internal */ export const WebhookDataWalletUpdated$outboundSchema: z.ZodType< WebhookDataWalletUpdated$Outbound, z.ZodTypeDef, WebhookDataWalletUpdated > = z.object({ accountID: z.string(), walletID: z.string(), status: WalletStatus$outboundSchema, }); export function webhookDataWalletUpdatedToJSON( webhookDataWalletUpdated: WebhookDataWalletUpdated, ): string { return JSON.stringify( WebhookDataWalletUpdated$outboundSchema.parse(webhookDataWalletUpdated), ); } export function webhookDataWalletUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataWalletUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataWalletUpdated' from JSON`, ); }