/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type PricingUnit = { unitKey: string; unit?: string | undefined; header?: string | undefined; entries: { [k: string]: number }; valueKeys: Array; default?: boolean | undefined; }; /** @internal */ export const PricingUnit$inboundSchema: z.ZodMiniType = z .object({ unitKey: types.string(), unit: types.optional(types.string()), header: types.optional(types.string()), entries: z.record(z.string(), types.number()), valueKeys: z.array(types.string()), default: types.optional(types.boolean()), }); export function pricingUnitFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PricingUnit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PricingUnit' from JSON`, ); }