/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { MetricUnit$inboundSchema, MetricUnit$outboundSchema, } from "./metricunit.js";
/** @internal */
export const Scalar$inboundSchema = z
    .object({
    name: z.string(),
    unit: MetricUnit$inboundSchema,
    value: z.number(),
});
/** @internal */
export const Scalar$outboundSchema = z.object({
    name: z.string(),
    unit: MetricUnit$outboundSchema,
    value: z.number(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Scalar$;
(function (Scalar$) {
    /** @deprecated use `Scalar$inboundSchema` instead. */
    Scalar$.inboundSchema = Scalar$inboundSchema;
    /** @deprecated use `Scalar$outboundSchema` instead. */
    Scalar$.outboundSchema = Scalar$outboundSchema;
})(Scalar$ || (Scalar$ = {}));
export function scalarToJSON(scalar) {
    return JSON.stringify(Scalar$outboundSchema.parse(scalar));
}
export function scalarFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Scalar$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Scalar' from JSON`);
}
//# sourceMappingURL=scalar.js.map