/* * 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 WebhookDataInvoiceCreated = { accountID: string; invoiceID: string; }; /** @internal */ export const WebhookDataInvoiceCreated$inboundSchema: z.ZodType< WebhookDataInvoiceCreated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), invoiceID: z.string(), }); /** @internal */ export type WebhookDataInvoiceCreated$Outbound = { accountID: string; invoiceID: string; }; /** @internal */ export const WebhookDataInvoiceCreated$outboundSchema: z.ZodType< WebhookDataInvoiceCreated$Outbound, z.ZodTypeDef, WebhookDataInvoiceCreated > = z.object({ accountID: z.string(), invoiceID: z.string(), }); export function webhookDataInvoiceCreatedToJSON( webhookDataInvoiceCreated: WebhookDataInvoiceCreated, ): string { return JSON.stringify( WebhookDataInvoiceCreated$outboundSchema.parse(webhookDataInvoiceCreated), ); } export function webhookDataInvoiceCreatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataInvoiceCreated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataInvoiceCreated' from JSON`, ); }