/* * 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 VolumeShareByCustomerType = { business?: number | undefined; consumer?: number | undefined; p2p?: number | undefined; }; /** @internal */ export const VolumeShareByCustomerType$inboundSchema: z.ZodType< VolumeShareByCustomerType, z.ZodTypeDef, unknown > = z.object({ business: z.number().int().optional(), consumer: z.number().int().optional(), p2p: z.number().int().optional(), }); /** @internal */ export type VolumeShareByCustomerType$Outbound = { business?: number | undefined; consumer?: number | undefined; p2p?: number | undefined; }; /** @internal */ export const VolumeShareByCustomerType$outboundSchema: z.ZodType< VolumeShareByCustomerType$Outbound, z.ZodTypeDef, VolumeShareByCustomerType > = z.object({ business: z.number().int().optional(), consumer: z.number().int().optional(), p2p: z.number().int().optional(), }); export function volumeShareByCustomerTypeToJSON( volumeShareByCustomerType: VolumeShareByCustomerType, ): string { return JSON.stringify( VolumeShareByCustomerType$outboundSchema.parse(volumeShareByCustomerType), ); } export function volumeShareByCustomerTypeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VolumeShareByCustomerType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VolumeShareByCustomerType' from JSON`, ); }