/* * 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 { InvoiceStatus, InvoiceStatus$inboundSchema, InvoiceStatus$outboundSchema, } from "./invoicestatus.js"; export type WebhookDataInvoiceUpdated = { accountID: string; invoiceID: string; status: InvoiceStatus; }; /** @internal */ export const WebhookDataInvoiceUpdated$inboundSchema: z.ZodType< WebhookDataInvoiceUpdated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), invoiceID: z.string(), status: InvoiceStatus$inboundSchema, }); /** @internal */ export type WebhookDataInvoiceUpdated$Outbound = { accountID: string; invoiceID: string; status: string; }; /** @internal */ export const WebhookDataInvoiceUpdated$outboundSchema: z.ZodType< WebhookDataInvoiceUpdated$Outbound, z.ZodTypeDef, WebhookDataInvoiceUpdated > = z.object({ accountID: z.string(), invoiceID: z.string(), status: InvoiceStatus$outboundSchema, }); export function webhookDataInvoiceUpdatedToJSON( webhookDataInvoiceUpdated: WebhookDataInvoiceUpdated, ): string { return JSON.stringify( WebhookDataInvoiceUpdated$outboundSchema.parse(webhookDataInvoiceUpdated), ); } export function webhookDataInvoiceUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataInvoiceUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataInvoiceUpdated' from JSON`, ); }