/* * 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 VolumeByCustomerType = { businessToBusinessPercentage: number; consumerToBusinessPercentage: number; }; /** @internal */ export const VolumeByCustomerType$inboundSchema: z.ZodType< VolumeByCustomerType, z.ZodTypeDef, unknown > = z.object({ businessToBusinessPercentage: z.number().int(), consumerToBusinessPercentage: z.number().int(), }); /** @internal */ export type VolumeByCustomerType$Outbound = { businessToBusinessPercentage: number; consumerToBusinessPercentage: number; }; /** @internal */ export const VolumeByCustomerType$outboundSchema: z.ZodType< VolumeByCustomerType$Outbound, z.ZodTypeDef, VolumeByCustomerType > = z.object({ businessToBusinessPercentage: z.number().int(), consumerToBusinessPercentage: z.number().int(), }); export function volumeByCustomerTypeToJSON( volumeByCustomerType: VolumeByCustomerType, ): string { return JSON.stringify( VolumeByCustomerType$outboundSchema.parse(volumeByCustomerType), ); } export function volumeByCustomerTypeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VolumeByCustomerType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VolumeByCustomerType' from JSON`, ); }