/* * 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 { CardUpdateReason, CardUpdateReason$inboundSchema, CardUpdateReason$outboundSchema, } from "./cardupdatereason.js"; export type WebhookDataCardAutoUpdated = { cardID: string; accountID: string; /** * The results of the card update request. */ updateType: CardUpdateReason; }; /** @internal */ export const WebhookDataCardAutoUpdated$inboundSchema: z.ZodType< WebhookDataCardAutoUpdated, z.ZodTypeDef, unknown > = z.object({ cardID: z.string(), accountID: z.string(), updateType: CardUpdateReason$inboundSchema, }); /** @internal */ export type WebhookDataCardAutoUpdated$Outbound = { cardID: string; accountID: string; updateType: string; }; /** @internal */ export const WebhookDataCardAutoUpdated$outboundSchema: z.ZodType< WebhookDataCardAutoUpdated$Outbound, z.ZodTypeDef, WebhookDataCardAutoUpdated > = z.object({ cardID: z.string(), accountID: z.string(), updateType: CardUpdateReason$outboundSchema, }); export function webhookDataCardAutoUpdatedToJSON( webhookDataCardAutoUpdated: WebhookDataCardAutoUpdated, ): string { return JSON.stringify( WebhookDataCardAutoUpdated$outboundSchema.parse(webhookDataCardAutoUpdated), ); } export function webhookDataCardAutoUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataCardAutoUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataCardAutoUpdated' from JSON`, ); }