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