/* * 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 { WebhookBillingStatementCreated, WebhookBillingStatementCreated$inboundSchema, WebhookBillingStatementCreated$Outbound, WebhookBillingStatementCreated$outboundSchema, } from "./webhookbillingstatementcreated.js"; import { WebhookDataAccountCreated, WebhookDataAccountCreated$inboundSchema, WebhookDataAccountCreated$Outbound, WebhookDataAccountCreated$outboundSchema, } from "./webhookdataaccountcreated.js"; import { WebhookDataAccountDisconnected, WebhookDataAccountDisconnected$inboundSchema, WebhookDataAccountDisconnected$Outbound, WebhookDataAccountDisconnected$outboundSchema, } from "./webhookdataaccountdisconnected.js"; import { WebhookDataAccountUpdated, WebhookDataAccountUpdated$inboundSchema, WebhookDataAccountUpdated$Outbound, WebhookDataAccountUpdated$outboundSchema, } from "./webhookdataaccountupdated.js"; import { WebhookDataBalanceUpdated, WebhookDataBalanceUpdated$inboundSchema, WebhookDataBalanceUpdated$Outbound, WebhookDataBalanceUpdated$outboundSchema, } from "./webhookdatabalanceupdated.js"; import { WebhookDataBankAccountCreated, WebhookDataBankAccountCreated$inboundSchema, WebhookDataBankAccountCreated$Outbound, WebhookDataBankAccountCreated$outboundSchema, } from "./webhookdatabankaccountcreated.js"; import { WebhookDataBankAccountDeleted, WebhookDataBankAccountDeleted$inboundSchema, WebhookDataBankAccountDeleted$Outbound, WebhookDataBankAccountDeleted$outboundSchema, } from "./webhookdatabankaccountdeleted.js"; import { WebhookDataBankAccountUpdated, WebhookDataBankAccountUpdated$inboundSchema, WebhookDataBankAccountUpdated$Outbound, WebhookDataBankAccountUpdated$outboundSchema, } from "./webhookdatabankaccountupdated.js"; import { WebhookDataCancellationCreated, WebhookDataCancellationCreated$inboundSchema, WebhookDataCancellationCreated$Outbound, WebhookDataCancellationCreated$outboundSchema, } from "./webhookdatacancellationcreated.js"; import { WebhookDataCancellationUpdated, WebhookDataCancellationUpdated$inboundSchema, WebhookDataCancellationUpdated$Outbound, WebhookDataCancellationUpdated$outboundSchema, } from "./webhookdatacancellationupdated.js"; import { WebhookDataCapabilityRequested, WebhookDataCapabilityRequested$inboundSchema, WebhookDataCapabilityRequested$Outbound, WebhookDataCapabilityRequested$outboundSchema, } from "./webhookdatacapabilityrequested.js"; import { WebhookDataCapabilityUpdated, WebhookDataCapabilityUpdated$inboundSchema, WebhookDataCapabilityUpdated$Outbound, WebhookDataCapabilityUpdated$outboundSchema, } from "./webhookdatacapabilityupdated.js"; import { WebhookDataCardAutoUpdated, WebhookDataCardAutoUpdated$inboundSchema, WebhookDataCardAutoUpdated$Outbound, WebhookDataCardAutoUpdated$outboundSchema, } from "./webhookdatacardautoupdated.js"; import { WebhookDataDisputeCreated, WebhookDataDisputeCreated$inboundSchema, WebhookDataDisputeCreated$Outbound, WebhookDataDisputeCreated$outboundSchema, } from "./webhookdatadisputecreated.js"; import { WebhookDataDisputeUpdated, WebhookDataDisputeUpdated$inboundSchema, WebhookDataDisputeUpdated$Outbound, WebhookDataDisputeUpdated$outboundSchema, } from "./webhookdatadisputeupdated.js"; import { WebhookDataInvoiceCreated, WebhookDataInvoiceCreated$inboundSchema, WebhookDataInvoiceCreated$Outbound, WebhookDataInvoiceCreated$outboundSchema, } from "./webhookdatainvoicecreated.js"; import { WebhookDataInvoiceUpdated, WebhookDataInvoiceUpdated$inboundSchema, WebhookDataInvoiceUpdated$Outbound, WebhookDataInvoiceUpdated$outboundSchema, } from "./webhookdatainvoiceupdated.js"; import { WebhookDataNetworkIDUpdated, WebhookDataNetworkIDUpdated$inboundSchema, WebhookDataNetworkIDUpdated$Outbound, WebhookDataNetworkIDUpdated$outboundSchema, } from "./webhookdatanetworkidupdated.js"; import { WebhookDataPaymentMethodDisabled, WebhookDataPaymentMethodDisabled$inboundSchema, WebhookDataPaymentMethodDisabled$Outbound, WebhookDataPaymentMethodDisabled$outboundSchema, } from "./webhookdatapaymentmethoddisabled.js"; import { WebhookDataPaymentMethodEnabled, WebhookDataPaymentMethodEnabled$inboundSchema, WebhookDataPaymentMethodEnabled$Outbound, WebhookDataPaymentMethodEnabled$outboundSchema, } from "./webhookdatapaymentmethodenabled.js"; import { WebhookDataRefundCreated, WebhookDataRefundCreated$inboundSchema, WebhookDataRefundCreated$Outbound, WebhookDataRefundCreated$outboundSchema, } from "./webhookdatarefundcreated.js"; import { WebhookDataRefundUpdated, WebhookDataRefundUpdated$inboundSchema, WebhookDataRefundUpdated$Outbound, WebhookDataRefundUpdated$outboundSchema, } from "./webhookdatarefundupdated.js"; import { WebhookDataRepresentativeCreated, WebhookDataRepresentativeCreated$inboundSchema, WebhookDataRepresentativeCreated$Outbound, WebhookDataRepresentativeCreated$outboundSchema, } from "./webhookdatarepresentativecreated.js"; import { WebhookDataRepresentativeDisabled, WebhookDataRepresentativeDisabled$inboundSchema, WebhookDataRepresentativeDisabled$Outbound, WebhookDataRepresentativeDisabled$outboundSchema, } from "./webhookdatarepresentativedisabled.js"; import { WebhookDataRepresentativeUpdated, WebhookDataRepresentativeUpdated$inboundSchema, WebhookDataRepresentativeUpdated$Outbound, WebhookDataRepresentativeUpdated$outboundSchema, } from "./webhookdatarepresentativeupdated.js"; import { WebhookDataSweepCreated, WebhookDataSweepCreated$inboundSchema, WebhookDataSweepCreated$Outbound, WebhookDataSweepCreated$outboundSchema, } from "./webhookdatasweepcreated.js"; import { WebhookDataSweepUpdated, WebhookDataSweepUpdated$inboundSchema, WebhookDataSweepUpdated$Outbound, WebhookDataSweepUpdated$outboundSchema, } from "./webhookdatasweepupdated.js"; import { WebhookDataTerminalApplicationCreated, WebhookDataTerminalApplicationCreated$inboundSchema, WebhookDataTerminalApplicationCreated$Outbound, WebhookDataTerminalApplicationCreated$outboundSchema, } from "./webhookdataterminalapplicationcreated.js"; import { WebhookDataTerminalApplicationUpdated, WebhookDataTerminalApplicationUpdated$inboundSchema, WebhookDataTerminalApplicationUpdated$Outbound, WebhookDataTerminalApplicationUpdated$outboundSchema, } from "./webhookdataterminalapplicationupdated.js"; import { WebhookDataTicketCreated, WebhookDataTicketCreated$inboundSchema, WebhookDataTicketCreated$Outbound, WebhookDataTicketCreated$outboundSchema, } from "./webhookdataticketcreated.js"; import { WebhookDataTicketMessageAdded, WebhookDataTicketMessageAdded$inboundSchema, WebhookDataTicketMessageAdded$Outbound, WebhookDataTicketMessageAdded$outboundSchema, } from "./webhookdataticketmessageadded.js"; import { WebhookDataTicketUpdated, WebhookDataTicketUpdated$inboundSchema, WebhookDataTicketUpdated$Outbound, WebhookDataTicketUpdated$outboundSchema, } from "./webhookdataticketupdated.js"; import { WebhookDataTransferCreated, WebhookDataTransferCreated$inboundSchema, WebhookDataTransferCreated$Outbound, WebhookDataTransferCreated$outboundSchema, } from "./webhookdatatransfercreated.js"; import { WebhookDataTransferUpdated, WebhookDataTransferUpdated$inboundSchema, WebhookDataTransferUpdated$Outbound, WebhookDataTransferUpdated$outboundSchema, } from "./webhookdatatransferupdated.js"; import { WebhookDataWalletCreated, WebhookDataWalletCreated$inboundSchema, WebhookDataWalletCreated$Outbound, WebhookDataWalletCreated$outboundSchema, } from "./webhookdatawalletcreated.js"; import { WebhookDataWalletTransactionUpdated, WebhookDataWalletTransactionUpdated$inboundSchema, WebhookDataWalletTransactionUpdated$Outbound, WebhookDataWalletTransactionUpdated$outboundSchema, } from "./webhookdatawallettransactionupdated.js"; import { WebhookDataWalletUpdated, WebhookDataWalletUpdated$inboundSchema, WebhookDataWalletUpdated$Outbound, WebhookDataWalletUpdated$outboundSchema, } from "./webhookdatawalletupdated.js"; /** * The data for the webhook event. The contents are based on the event type. */ export type WebhookData = | WebhookDataDisputeCreated | WebhookDataDisputeUpdated | WebhookDataTransferUpdated | WebhookDataBankAccountUpdated | WebhookDataRefundUpdated | WebhookDataWalletTransactionUpdated | WebhookDataCancellationCreated | WebhookDataCancellationUpdated | WebhookDataCardAutoUpdated | WebhookDataCapabilityUpdated | WebhookDataInvoiceUpdated | WebhookDataPaymentMethodEnabled | WebhookDataPaymentMethodDisabled | WebhookDataRefundCreated | WebhookDataSweepUpdated | WebhookDataTicketUpdated | WebhookDataTransferCreated | WebhookDataWalletUpdated | WebhookDataBalanceUpdated | WebhookDataBankAccountCreated | WebhookDataBankAccountDeleted | WebhookDataCapabilityRequested | WebhookDataInvoiceCreated | WebhookDataRepresentativeCreated | WebhookDataRepresentativeUpdated | WebhookDataRepresentativeDisabled | WebhookDataSweepCreated | WebhookDataTerminalApplicationCreated | WebhookDataTerminalApplicationUpdated | WebhookDataTicketCreated | WebhookDataTicketMessageAdded | WebhookDataWalletCreated | WebhookDataAccountCreated | WebhookDataAccountUpdated | WebhookDataAccountDisconnected | WebhookDataNetworkIDUpdated | WebhookBillingStatementCreated; /** @internal */ export const WebhookData$inboundSchema: z.ZodType< WebhookData, z.ZodTypeDef, unknown > = z.union([ WebhookDataDisputeCreated$inboundSchema, WebhookDataDisputeUpdated$inboundSchema, WebhookDataTransferUpdated$inboundSchema, WebhookDataBankAccountUpdated$inboundSchema, WebhookDataRefundUpdated$inboundSchema, WebhookDataWalletTransactionUpdated$inboundSchema, WebhookDataCancellationCreated$inboundSchema, WebhookDataCancellationUpdated$inboundSchema, WebhookDataCardAutoUpdated$inboundSchema, WebhookDataCapabilityUpdated$inboundSchema, WebhookDataInvoiceUpdated$inboundSchema, WebhookDataPaymentMethodEnabled$inboundSchema, WebhookDataPaymentMethodDisabled$inboundSchema, WebhookDataRefundCreated$inboundSchema, WebhookDataSweepUpdated$inboundSchema, WebhookDataTicketUpdated$inboundSchema, WebhookDataTransferCreated$inboundSchema, WebhookDataWalletUpdated$inboundSchema, WebhookDataBalanceUpdated$inboundSchema, WebhookDataBankAccountCreated$inboundSchema, WebhookDataBankAccountDeleted$inboundSchema, WebhookDataCapabilityRequested$inboundSchema, WebhookDataInvoiceCreated$inboundSchema, WebhookDataRepresentativeCreated$inboundSchema, WebhookDataRepresentativeUpdated$inboundSchema, WebhookDataRepresentativeDisabled$inboundSchema, WebhookDataSweepCreated$inboundSchema, WebhookDataTerminalApplicationCreated$inboundSchema, WebhookDataTerminalApplicationUpdated$inboundSchema, WebhookDataTicketCreated$inboundSchema, WebhookDataTicketMessageAdded$inboundSchema, WebhookDataWalletCreated$inboundSchema, WebhookDataAccountCreated$inboundSchema, WebhookDataAccountUpdated$inboundSchema, WebhookDataAccountDisconnected$inboundSchema, WebhookDataNetworkIDUpdated$inboundSchema, WebhookBillingStatementCreated$inboundSchema, ]); /** @internal */ export type WebhookData$Outbound = | WebhookDataDisputeCreated$Outbound | WebhookDataDisputeUpdated$Outbound | WebhookDataTransferUpdated$Outbound | WebhookDataBankAccountUpdated$Outbound | WebhookDataRefundUpdated$Outbound | WebhookDataWalletTransactionUpdated$Outbound | WebhookDataCancellationCreated$Outbound | WebhookDataCancellationUpdated$Outbound | WebhookDataCardAutoUpdated$Outbound | WebhookDataCapabilityUpdated$Outbound | WebhookDataInvoiceUpdated$Outbound | WebhookDataPaymentMethodEnabled$Outbound | WebhookDataPaymentMethodDisabled$Outbound | WebhookDataRefundCreated$Outbound | WebhookDataSweepUpdated$Outbound | WebhookDataTicketUpdated$Outbound | WebhookDataTransferCreated$Outbound | WebhookDataWalletUpdated$Outbound | WebhookDataBalanceUpdated$Outbound | WebhookDataBankAccountCreated$Outbound | WebhookDataBankAccountDeleted$Outbound | WebhookDataCapabilityRequested$Outbound | WebhookDataInvoiceCreated$Outbound | WebhookDataRepresentativeCreated$Outbound | WebhookDataRepresentativeUpdated$Outbound | WebhookDataRepresentativeDisabled$Outbound | WebhookDataSweepCreated$Outbound | WebhookDataTerminalApplicationCreated$Outbound | WebhookDataTerminalApplicationUpdated$Outbound | WebhookDataTicketCreated$Outbound | WebhookDataTicketMessageAdded$Outbound | WebhookDataWalletCreated$Outbound | WebhookDataAccountCreated$Outbound | WebhookDataAccountUpdated$Outbound | WebhookDataAccountDisconnected$Outbound | WebhookDataNetworkIDUpdated$Outbound | WebhookBillingStatementCreated$Outbound; /** @internal */ export const WebhookData$outboundSchema: z.ZodType< WebhookData$Outbound, z.ZodTypeDef, WebhookData > = z.union([ WebhookDataDisputeCreated$outboundSchema, WebhookDataDisputeUpdated$outboundSchema, WebhookDataTransferUpdated$outboundSchema, WebhookDataBankAccountUpdated$outboundSchema, WebhookDataRefundUpdated$outboundSchema, WebhookDataWalletTransactionUpdated$outboundSchema, WebhookDataCancellationCreated$outboundSchema, WebhookDataCancellationUpdated$outboundSchema, WebhookDataCardAutoUpdated$outboundSchema, WebhookDataCapabilityUpdated$outboundSchema, WebhookDataInvoiceUpdated$outboundSchema, WebhookDataPaymentMethodEnabled$outboundSchema, WebhookDataPaymentMethodDisabled$outboundSchema, WebhookDataRefundCreated$outboundSchema, WebhookDataSweepUpdated$outboundSchema, WebhookDataTicketUpdated$outboundSchema, WebhookDataTransferCreated$outboundSchema, WebhookDataWalletUpdated$outboundSchema, WebhookDataBalanceUpdated$outboundSchema, WebhookDataBankAccountCreated$outboundSchema, WebhookDataBankAccountDeleted$outboundSchema, WebhookDataCapabilityRequested$outboundSchema, WebhookDataInvoiceCreated$outboundSchema, WebhookDataRepresentativeCreated$outboundSchema, WebhookDataRepresentativeUpdated$outboundSchema, WebhookDataRepresentativeDisabled$outboundSchema, WebhookDataSweepCreated$outboundSchema, WebhookDataTerminalApplicationCreated$outboundSchema, WebhookDataTerminalApplicationUpdated$outboundSchema, WebhookDataTicketCreated$outboundSchema, WebhookDataTicketMessageAdded$outboundSchema, WebhookDataWalletCreated$outboundSchema, WebhookDataAccountCreated$outboundSchema, WebhookDataAccountUpdated$outboundSchema, WebhookDataAccountDisconnected$outboundSchema, WebhookDataNetworkIDUpdated$outboundSchema, WebhookBillingStatementCreated$outboundSchema, ]); export function webhookDataToJSON(webhookData: WebhookData): string { return JSON.stringify(WebhookData$outboundSchema.parse(webhookData)); } export function webhookDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookData' from JSON`, ); }