/* * 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"; export type CardVolumeDistribution = { ecommercePercentage: number; cardPresentPercentage: number; mailOrPhonePercentage: number; debtRepaymentPercentage: number; }; /** @internal */ export const CardVolumeDistribution$inboundSchema: z.ZodType< CardVolumeDistribution, z.ZodTypeDef, unknown > = z.object({ ecommercePercentage: z.number().int(), cardPresentPercentage: z.number().int(), mailOrPhonePercentage: z.number().int(), debtRepaymentPercentage: z.number().int(), }); /** @internal */ export type CardVolumeDistribution$Outbound = { ecommercePercentage: number; cardPresentPercentage: number; mailOrPhonePercentage: number; debtRepaymentPercentage: number; }; /** @internal */ export const CardVolumeDistribution$outboundSchema: z.ZodType< CardVolumeDistribution$Outbound, z.ZodTypeDef, CardVolumeDistribution > = z.object({ ecommercePercentage: z.number().int(), cardPresentPercentage: z.number().int(), mailOrPhonePercentage: z.number().int(), debtRepaymentPercentage: z.number().int(), }); export function cardVolumeDistributionToJSON( cardVolumeDistribution: CardVolumeDistribution, ): string { return JSON.stringify( CardVolumeDistribution$outboundSchema.parse(cardVolumeDistribution), ); } export function cardVolumeDistributionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CardVolumeDistribution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CardVolumeDistribution' from JSON`, ); }