/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Accumulation$inboundSchema, Accumulation$outboundSchema, } from "./accumulation.js";
import { Gauge$inboundSchema, Gauge$outboundSchema, } from "./gauge.js";
import { Label$inboundSchema, Label$outboundSchema, } from "./label.js";
import { Scalar$inboundSchema, Scalar$outboundSchema, } from "./scalar.js";
/** @internal */
export const Four$inboundSchema = z
    .object({
    label: Label$inboundSchema,
});
/** @internal */
export const Four$outboundSchema = z.object({
    label: Label$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Four$;
(function (Four$) {
    /** @deprecated use `Four$inboundSchema` instead. */
    Four$.inboundSchema = Four$inboundSchema;
    /** @deprecated use `Four$outboundSchema` instead. */
    Four$.outboundSchema = Four$outboundSchema;
})(Four$ || (Four$ = {}));
export function fourToJSON(four) {
    return JSON.stringify(Four$outboundSchema.parse(four));
}
export function fourFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Four$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Four' from JSON`);
}
/** @internal */
export const Three$inboundSchema = z
    .object({
    gauge: Gauge$inboundSchema,
});
/** @internal */
export const Three$outboundSchema = z.object({
    gauge: Gauge$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Three$;
(function (Three$) {
    /** @deprecated use `Three$inboundSchema` instead. */
    Three$.inboundSchema = Three$inboundSchema;
    /** @deprecated use `Three$outboundSchema` instead. */
    Three$.outboundSchema = Three$outboundSchema;
})(Three$ || (Three$ = {}));
export function threeToJSON(three) {
    return JSON.stringify(Three$outboundSchema.parse(three));
}
export function threeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Three$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Three' from JSON`);
}
/** @internal */
export const Two$inboundSchema = z
    .object({
    accumulation: Accumulation$inboundSchema,
});
/** @internal */
export const Two$outboundSchema = z
    .object({
    accumulation: Accumulation$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Two$;
(function (Two$) {
    /** @deprecated use `Two$inboundSchema` instead. */
    Two$.inboundSchema = Two$inboundSchema;
    /** @deprecated use `Two$outboundSchema` instead. */
    Two$.outboundSchema = Two$outboundSchema;
})(Two$ || (Two$ = {}));
export function twoToJSON(two) {
    return JSON.stringify(Two$outboundSchema.parse(two));
}
export function twoFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Two$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Two' from JSON`);
}
/** @internal */
export const Metric1$inboundSchema = z.object({
    scalar: Scalar$inboundSchema,
});
/** @internal */
export const Metric1$outboundSchema = z.object({
    scalar: Scalar$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Metric1$;
(function (Metric1$) {
    /** @deprecated use `Metric1$inboundSchema` instead. */
    Metric1$.inboundSchema = Metric1$inboundSchema;
    /** @deprecated use `Metric1$outboundSchema` instead. */
    Metric1$.outboundSchema = Metric1$outboundSchema;
})(Metric1$ || (Metric1$ = {}));
export function metric1ToJSON(metric1) {
    return JSON.stringify(Metric1$outboundSchema.parse(metric1));
}
export function metric1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => Metric1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Metric1' from JSON`);
}
/** @internal */
export const Metric$inboundSchema = z
    .union([
    z.lazy(() => Metric1$inboundSchema),
    z.lazy(() => Two$inboundSchema),
    z.lazy(() => Three$inboundSchema),
    z.lazy(() => Four$inboundSchema),
]);
/** @internal */
export const Metric$outboundSchema = z.union([
    z.lazy(() => Metric1$outboundSchema),
    z.lazy(() => Two$outboundSchema),
    z.lazy(() => Three$outboundSchema),
    z.lazy(() => Four$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Metric$;
(function (Metric$) {
    /** @deprecated use `Metric$inboundSchema` instead. */
    Metric$.inboundSchema = Metric$inboundSchema;
    /** @deprecated use `Metric$outboundSchema` instead. */
    Metric$.outboundSchema = Metric$outboundSchema;
})(Metric$ || (Metric$ = {}));
export function metricToJSON(metric) {
    return JSON.stringify(Metric$outboundSchema.parse(metric));
}
export function metricFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Metric$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Metric' from JSON`);
}
//# sourceMappingURL=metric.js.map