/* * 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 { WebhookDataTransferStatus, WebhookDataTransferStatus$inboundSchema, WebhookDataTransferStatus$outboundSchema, } from "./webhookdatatransferstatus.js"; import { WebhookTransferPaymentMethodDetails, WebhookTransferPaymentMethodDetails$inboundSchema, WebhookTransferPaymentMethodDetails$Outbound, WebhookTransferPaymentMethodDetails$outboundSchema, } from "./webhooktransferpaymentmethoddetails.js"; export type WebhookDataTransferUpdated = { /** * The accountID which facilitated the transfer. */ accountID: string; transferID: string; status: WebhookDataTransferStatus; /** * Payment method details for the source or destination of a transfer. */ source: WebhookTransferPaymentMethodDetails; /** * Payment method details for the source or destination of a transfer. */ destination: WebhookTransferPaymentMethodDetails; foreignID?: string | undefined; }; /** @internal */ export const WebhookDataTransferUpdated$inboundSchema: z.ZodType< WebhookDataTransferUpdated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), transferID: z.string(), status: WebhookDataTransferStatus$inboundSchema, source: WebhookTransferPaymentMethodDetails$inboundSchema, destination: WebhookTransferPaymentMethodDetails$inboundSchema, foreignID: z.string().optional(), }); /** @internal */ export type WebhookDataTransferUpdated$Outbound = { accountID: string; transferID: string; status: string; source: WebhookTransferPaymentMethodDetails$Outbound; destination: WebhookTransferPaymentMethodDetails$Outbound; foreignID?: string | undefined; }; /** @internal */ export const WebhookDataTransferUpdated$outboundSchema: z.ZodType< WebhookDataTransferUpdated$Outbound, z.ZodTypeDef, WebhookDataTransferUpdated > = z.object({ accountID: z.string(), transferID: z.string(), status: WebhookDataTransferStatus$outboundSchema, source: WebhookTransferPaymentMethodDetails$outboundSchema, destination: WebhookTransferPaymentMethodDetails$outboundSchema, foreignID: z.string().optional(), }); export function webhookDataTransferUpdatedToJSON( webhookDataTransferUpdated: WebhookDataTransferUpdated, ): string { return JSON.stringify( WebhookDataTransferUpdated$outboundSchema.parse(webhookDataTransferUpdated), ); } export function webhookDataTransferUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataTransferUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataTransferUpdated' from JSON`, ); }