/* * 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 { WebhookDtoWalletTransaction, WebhookDtoWalletTransaction$inboundSchema, } from "./webhook-dto-wallet-transaction.js"; import { WebhookEventName, WebhookEventName$inboundSchema, } from "./webhook-event-name.js"; export type WebhookDtoTransactionUpdatedWebhookPayload = { eventType?: WebhookEventName | undefined; updatedTransaction?: WebhookDtoWalletTransaction | undefined; }; /** @internal */ export const WebhookDtoTransactionUpdatedWebhookPayload$inboundSchema: z.ZodMiniType = z.pipe( z.object({ event_type: types.optional(WebhookEventName$inboundSchema), updated_transaction: types.optional( WebhookDtoWalletTransaction$inboundSchema, ), }), z.transform((v) => { return remap$(v, { "event_type": "eventType", "updated_transaction": "updatedTransaction", }); }), ); export function webhookDtoTransactionUpdatedWebhookPayloadFromJSON( jsonString: string, ): SafeParseResult< WebhookDtoTransactionUpdatedWebhookPayload, SDKValidationError > { return safeParse( jsonString, (x) => WebhookDtoTransactionUpdatedWebhookPayload$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WebhookDtoTransactionUpdatedWebhookPayload' from JSON`, ); }