/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { WebhookDtoWalletAlertInfo, WebhookDtoWalletAlertInfo$inboundSchema, } from "./webhook-dto-wallet-alert-info.js"; import { WebhookDtoWallet, WebhookDtoWallet$inboundSchema, } from "./webhook-dto-wallet.js"; import { WebhookEventName, WebhookEventName$inboundSchema, } from "./webhook-event-name.js"; export type WebhookDtoWalletWebhookPayload = { alert?: WebhookDtoWalletAlertInfo | undefined; eventType?: WebhookEventName | undefined; wallet?: WebhookDtoWallet | undefined; }; /** @internal */ export const WebhookDtoWalletWebhookPayload$inboundSchema: z.ZodMiniType< WebhookDtoWalletWebhookPayload, unknown > = z.pipe( z.object({ alert: types.optional(WebhookDtoWalletAlertInfo$inboundSchema), event_type: types.optional(WebhookEventName$inboundSchema), wallet: types.optional(WebhookDtoWallet$inboundSchema), }), z.transform((v) => { return remap$(v, { "event_type": "eventType", }); }), ); export function webhookDtoWalletWebhookPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDtoWalletWebhookPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDtoWalletWebhookPayload' from JSON`, ); }