/* * 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"; export type WebhookDataAccountUpdated = { accountID: string; foreignID?: string | undefined; }; /** @internal */ export const WebhookDataAccountUpdated$inboundSchema: z.ZodType< WebhookDataAccountUpdated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), foreignID: z.string().optional(), }); /** @internal */ export type WebhookDataAccountUpdated$Outbound = { accountID: string; foreignID?: string | undefined; }; /** @internal */ export const WebhookDataAccountUpdated$outboundSchema: z.ZodType< WebhookDataAccountUpdated$Outbound, z.ZodTypeDef, WebhookDataAccountUpdated > = z.object({ accountID: z.string(), foreignID: z.string().optional(), }); export function webhookDataAccountUpdatedToJSON( webhookDataAccountUpdated: WebhookDataAccountUpdated, ): string { return JSON.stringify( WebhookDataAccountUpdated$outboundSchema.parse(webhookDataAccountUpdated), ); } export function webhookDataAccountUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataAccountUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataAccountUpdated' from JSON`, ); }