/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PerformanceMetric = { metric: string; description: string; }; /** @internal */ export const PerformanceMetric$inboundSchema: z.ZodType< PerformanceMetric, z.ZodTypeDef, unknown > = z.object({ metric: z.string(), description: z.string(), }); /** @internal */ export type PerformanceMetric$Outbound = { metric: string; description: string; }; /** @internal */ export const PerformanceMetric$outboundSchema: z.ZodType< PerformanceMetric$Outbound, z.ZodTypeDef, PerformanceMetric > = z.object({ metric: z.string(), description: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PerformanceMetric$ { /** @deprecated use `PerformanceMetric$inboundSchema` instead. */ export const inboundSchema = PerformanceMetric$inboundSchema; /** @deprecated use `PerformanceMetric$outboundSchema` instead. */ export const outboundSchema = PerformanceMetric$outboundSchema; /** @deprecated use `PerformanceMetric$Outbound` instead. */ export type Outbound = PerformanceMetric$Outbound; } export function performanceMetricToJSON( performanceMetric: PerformanceMetric, ): string { return JSON.stringify( PerformanceMetric$outboundSchema.parse(performanceMetric), ); } export function performanceMetricFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PerformanceMetric$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PerformanceMetric' from JSON`, ); }