/* * 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 { SDKValidationError } from "./sdk-validation-error.js"; import { WalletStatus, WalletStatus$inboundSchema } from "./wallet-status.js"; import { WalletType, WalletType$inboundSchema } from "./wallet-type.js"; export type WebhookDtoWallet = { balance?: string | undefined; conversionRate?: string | undefined; creditBalance?: string | undefined; currency?: string | undefined; customerId?: string | undefined; id?: string | undefined; name?: string | undefined; walletStatus?: WalletStatus | undefined; walletType?: WalletType | undefined; }; /** @internal */ export const WebhookDtoWallet$inboundSchema: z.ZodMiniType< WebhookDtoWallet, unknown > = z.pipe( z.object({ balance: types.optional(types.string()), conversion_rate: types.optional(types.string()), credit_balance: types.optional(types.string()), currency: types.optional(types.string()), customer_id: types.optional(types.string()), id: types.optional(types.string()), name: types.optional(types.string()), wallet_status: types.optional(WalletStatus$inboundSchema), wallet_type: types.optional(WalletType$inboundSchema), }), z.transform((v) => { return remap$(v, { "conversion_rate": "conversionRate", "credit_balance": "creditBalance", "customer_id": "customerId", "wallet_status": "walletStatus", "wallet_type": "walletType", }); }), ); export function webhookDtoWalletFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDtoWallet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDtoWallet' from JSON`, ); }