/* * 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 { RefundStatus, RefundStatus$inboundSchema, RefundStatus$outboundSchema, } from "./refundstatus.js"; export type WebhookDataRefundUpdated = { accountID: string; transferID: string; refundID: string; status: RefundStatus; }; /** @internal */ export const WebhookDataRefundUpdated$inboundSchema: z.ZodType< WebhookDataRefundUpdated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), transferID: z.string(), refundID: z.string(), status: RefundStatus$inboundSchema, }); /** @internal */ export type WebhookDataRefundUpdated$Outbound = { accountID: string; transferID: string; refundID: string; status: string; }; /** @internal */ export const WebhookDataRefundUpdated$outboundSchema: z.ZodType< WebhookDataRefundUpdated$Outbound, z.ZodTypeDef, WebhookDataRefundUpdated > = z.object({ accountID: z.string(), transferID: z.string(), refundID: z.string(), status: RefundStatus$outboundSchema, }); export function webhookDataRefundUpdatedToJSON( webhookDataRefundUpdated: WebhookDataRefundUpdated, ): string { return JSON.stringify( WebhookDataRefundUpdated$outboundSchema.parse(webhookDataRefundUpdated), ); } export function webhookDataRefundUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataRefundUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataRefundUpdated' from JSON`, ); }