/* * 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 { CancellationStatus, CancellationStatus$inboundSchema, CancellationStatus$outboundSchema, } from "./cancellationstatus.js"; export type WebhookDataCancellationUpdated = { cancellationID: string; transferID: string; status: CancellationStatus; }; /** @internal */ export const WebhookDataCancellationUpdated$inboundSchema: z.ZodType< WebhookDataCancellationUpdated, z.ZodTypeDef, unknown > = z.object({ cancellationID: z.string(), transferID: z.string(), status: CancellationStatus$inboundSchema, }); /** @internal */ export type WebhookDataCancellationUpdated$Outbound = { cancellationID: string; transferID: string; status: string; }; /** @internal */ export const WebhookDataCancellationUpdated$outboundSchema: z.ZodType< WebhookDataCancellationUpdated$Outbound, z.ZodTypeDef, WebhookDataCancellationUpdated > = z.object({ cancellationID: z.string(), transferID: z.string(), status: CancellationStatus$outboundSchema, }); export function webhookDataCancellationUpdatedToJSON( webhookDataCancellationUpdated: WebhookDataCancellationUpdated, ): string { return JSON.stringify( WebhookDataCancellationUpdated$outboundSchema.parse( webhookDataCancellationUpdated, ), ); } export function webhookDataCancellationUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataCancellationUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataCancellationUpdated' from JSON`, ); }