/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { MetricType, MetricType$inboundSchema } from "./metrictype.js"; /** * Information about a metric. */ export type Metric = { /** * Unique identifier for the metric. */ slug: string; /** * Human-readable name for the metric. */ displayName: string; type: MetricType; }; /** @internal */ export const Metric$inboundSchema: z.ZodMiniType = z.pipe( z.object({ slug: z.string(), display_name: z.string(), type: MetricType$inboundSchema, }), z.transform((v) => { return remap$(v, { "display_name": "displayName", }); }), ); export function metricFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Metric$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Metric' from JSON`, ); }