/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; export type GetFuturesForecastsRequest = { /** * Future symbol */ symbol: string; /** * Start of forecast window (YYYY-MM-DD). The returned * * @remarks * object will contain every forecast made between start_date and * end_date. _Default value_ : most recent date with forecasts */ startDate?: string | null | undefined; /** * End of forecast window (YYYY-MM-DD). The returned * * @remarks * object will contain every forecast made between start_date and * end_date. _Default value_ : most recent date with forecasts */ endDate?: string | null | undefined; /** * Interpolate between forecast horizons and return * * @remarks * daily forecast. */ interpolate?: boolean | undefined; /** * Estimate prediction uncertainty based on recent * * @remarks * historical accuracy. */ estimateUncertainty?: boolean | undefined; /** * Return market drivers for each forecast. */ getMarketDrivers?: boolean | undefined; /** * Return moving averages for each forecast. */ getMovingAverages?: boolean | undefined; /** * Apply an empirical price collar to the forecasts. This regulates the forecast when it suggests implausibly large price changes. A smaller number results in a more aggressive collar. Must be a positive number. */ priceCollarSigma?: number | undefined; /** * Select a specific data model to use when generating a forecast for a future symbol. */ modelName?: string | null | undefined; }; /** @internal */ export const GetFuturesForecastsRequest$inboundSchema: z.ZodType< GetFuturesForecastsRequest, z.ZodTypeDef, unknown > = z.object({ symbol: z.string(), start_date: z.nullable(z.string()).optional(), end_date: z.nullable(z.string()).optional(), interpolate: z.boolean().default(false), estimate_uncertainty: z.boolean().default(false), get_market_drivers: z.boolean().default(false), get_moving_averages: z.boolean().default(false), price_collar_sigma: z.number().default(0), model_name: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "start_date": "startDate", "end_date": "endDate", "estimate_uncertainty": "estimateUncertainty", "get_market_drivers": "getMarketDrivers", "get_moving_averages": "getMovingAverages", "price_collar_sigma": "priceCollarSigma", "model_name": "modelName", }); }); /** @internal */ export type GetFuturesForecastsRequest$Outbound = { symbol: string; start_date?: string | null | undefined; end_date?: string | null | undefined; interpolate: boolean; estimate_uncertainty: boolean; get_market_drivers: boolean; get_moving_averages: boolean; price_collar_sigma: number; model_name?: string | null | undefined; }; /** @internal */ export const GetFuturesForecastsRequest$outboundSchema: z.ZodType< GetFuturesForecastsRequest$Outbound, z.ZodTypeDef, GetFuturesForecastsRequest > = z.object({ symbol: z.string(), startDate: z.nullable(z.string()).optional(), endDate: z.nullable(z.string()).optional(), interpolate: z.boolean().default(false), estimateUncertainty: z.boolean().default(false), getMarketDrivers: z.boolean().default(false), getMovingAverages: z.boolean().default(false), priceCollarSigma: z.number().default(0), modelName: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { startDate: "start_date", endDate: "end_date", estimateUncertainty: "estimate_uncertainty", getMarketDrivers: "get_market_drivers", getMovingAverages: "get_moving_averages", priceCollarSigma: "price_collar_sigma", modelName: "model_name", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetFuturesForecastsRequest$ { /** @deprecated use `GetFuturesForecastsRequest$inboundSchema` instead. */ export const inboundSchema = GetFuturesForecastsRequest$inboundSchema; /** @deprecated use `GetFuturesForecastsRequest$outboundSchema` instead. */ export const outboundSchema = GetFuturesForecastsRequest$outboundSchema; /** @deprecated use `GetFuturesForecastsRequest$Outbound` instead. */ export type Outbound = GetFuturesForecastsRequest$Outbound; } export function getFuturesForecastsRequestToJSON( getFuturesForecastsRequest: GetFuturesForecastsRequest, ): string { return JSON.stringify( GetFuturesForecastsRequest$outboundSchema.parse(getFuturesForecastsRequest), ); } export function getFuturesForecastsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetFuturesForecastsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFuturesForecastsRequest' from JSON`, ); }