/* * 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 ComputePriceRange = { max: number; min: number; }; /** @internal */ export const ComputePriceRange$inboundSchema: z.ZodType< ComputePriceRange, z.ZodTypeDef, unknown > = z.object({ max: z.number(), min: z.number(), }); /** @internal */ export type ComputePriceRange$Outbound = { max: number; min: number; }; /** @internal */ export const ComputePriceRange$outboundSchema: z.ZodType< ComputePriceRange$Outbound, z.ZodTypeDef, ComputePriceRange > = z.object({ max: z.number(), min: z.number(), }); export function computePriceRangeToJSON( computePriceRange: ComputePriceRange, ): string { return JSON.stringify( ComputePriceRange$outboundSchema.parse(computePriceRange), ); } export function computePriceRangeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputePriceRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputePriceRange' from JSON`, ); }