/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { AlertState, AlertState$inboundSchema } from "./alert-state.js"; import { AlertType, AlertType$inboundSchema } from "./alert-type.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { WebhookEventName, WebhookEventName$inboundSchema, } from "./webhook-event-name.js"; export type WebhookDtoAlertWebhookPayload = { alertStatus?: AlertState | undefined; alertType?: AlertType | undefined; creditBalance?: string | undefined; currentBalance?: string | undefined; customerId?: string | undefined; eventType?: WebhookEventName | undefined; featureId?: string | undefined; walletId?: string | undefined; }; /** @internal */ export const WebhookDtoAlertWebhookPayload$inboundSchema: z.ZodMiniType< WebhookDtoAlertWebhookPayload, unknown > = z.pipe( z.object({ alert_status: types.optional(AlertState$inboundSchema), alert_type: types.optional(AlertType$inboundSchema), credit_balance: types.optional(types.string()), current_balance: types.optional(types.string()), customer_id: types.optional(types.string()), event_type: types.optional(WebhookEventName$inboundSchema), feature_id: types.optional(types.string()), wallet_id: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "alert_status": "alertStatus", "alert_type": "alertType", "credit_balance": "creditBalance", "current_balance": "currentBalance", "customer_id": "customerId", "event_type": "eventType", "feature_id": "featureId", "wallet_id": "walletId", }); }), ); export function webhookDtoAlertWebhookPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDtoAlertWebhookPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDtoAlertWebhookPayload' from JSON`, ); }