/* * 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 ForecastTrajectoryElement = { model: string; horizon: number; }; /** @internal */ export const ForecastTrajectoryElement$inboundSchema: z.ZodType< ForecastTrajectoryElement, z.ZodTypeDef, unknown > = z.object({ model: z.string(), horizon: z.number().int(), }); /** @internal */ export type ForecastTrajectoryElement$Outbound = { model: string; horizon: number; }; /** @internal */ export const ForecastTrajectoryElement$outboundSchema: z.ZodType< ForecastTrajectoryElement$Outbound, z.ZodTypeDef, ForecastTrajectoryElement > = z.object({ model: z.string(), horizon: z.number().int(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ForecastTrajectoryElement$ { /** @deprecated use `ForecastTrajectoryElement$inboundSchema` instead. */ export const inboundSchema = ForecastTrajectoryElement$inboundSchema; /** @deprecated use `ForecastTrajectoryElement$outboundSchema` instead. */ export const outboundSchema = ForecastTrajectoryElement$outboundSchema; /** @deprecated use `ForecastTrajectoryElement$Outbound` instead. */ export type Outbound = ForecastTrajectoryElement$Outbound; } export function forecastTrajectoryElementToJSON( forecastTrajectoryElement: ForecastTrajectoryElement, ): string { return JSON.stringify( ForecastTrajectoryElement$outboundSchema.parse(forecastTrajectoryElement), ); } export function forecastTrajectoryElementFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ForecastTrajectoryElement$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ForecastTrajectoryElement' from JSON`, ); }