/* * 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 { SweepStatus, SweepStatus$inboundSchema, SweepStatus$outboundSchema, } from "./sweepstatus.js"; export type WebhookDataSweepUpdated = { walletID: string; sweepID: string; transferID?: string | undefined; status: SweepStatus; }; /** @internal */ export const WebhookDataSweepUpdated$inboundSchema: z.ZodType< WebhookDataSweepUpdated, z.ZodTypeDef, unknown > = z.object({ walletID: z.string(), sweepID: z.string(), transferID: z.string().optional(), status: SweepStatus$inboundSchema, }); /** @internal */ export type WebhookDataSweepUpdated$Outbound = { walletID: string; sweepID: string; transferID?: string | undefined; status: string; }; /** @internal */ export const WebhookDataSweepUpdated$outboundSchema: z.ZodType< WebhookDataSweepUpdated$Outbound, z.ZodTypeDef, WebhookDataSweepUpdated > = z.object({ walletID: z.string(), sweepID: z.string(), transferID: z.string().optional(), status: SweepStatus$outboundSchema, }); export function webhookDataSweepUpdatedToJSON( webhookDataSweepUpdated: WebhookDataSweepUpdated, ): string { return JSON.stringify( WebhookDataSweepUpdated$outboundSchema.parse(webhookDataSweepUpdated), ); } export function webhookDataSweepUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataSweepUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataSweepUpdated' from JSON`, ); }