/* * 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 CardVolumeDistributionError = { ecommercePercentage?: string | undefined; cardPresentPercentage?: string | undefined; mailOrPhonePercentage?: string | undefined; debtRepaymentPercentage?: string | undefined; }; /** @internal */ export const CardVolumeDistributionError$inboundSchema: z.ZodType< CardVolumeDistributionError, z.ZodTypeDef, unknown > = z.object({ ecommercePercentage: z.string().optional(), cardPresentPercentage: z.string().optional(), mailOrPhonePercentage: z.string().optional(), debtRepaymentPercentage: z.string().optional(), }); /** @internal */ export type CardVolumeDistributionError$Outbound = { ecommercePercentage?: string | undefined; cardPresentPercentage?: string | undefined; mailOrPhonePercentage?: string | undefined; debtRepaymentPercentage?: string | undefined; }; /** @internal */ export const CardVolumeDistributionError$outboundSchema: z.ZodType< CardVolumeDistributionError$Outbound, z.ZodTypeDef, CardVolumeDistributionError > = z.object({ ecommercePercentage: z.string().optional(), cardPresentPercentage: z.string().optional(), mailOrPhonePercentage: z.string().optional(), debtRepaymentPercentage: z.string().optional(), }); export function cardVolumeDistributionErrorToJSON( cardVolumeDistributionError: CardVolumeDistributionError, ): string { return JSON.stringify( CardVolumeDistributionError$outboundSchema.parse( cardVolumeDistributionError, ), ); } export function cardVolumeDistributionErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CardVolumeDistributionError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CardVolumeDistributionError' from JSON`, ); }