/* * 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 GetLongTermForecastRequest = { /** * Future symbol */ symbol: string; /** * Number of months to forecast. _Default value_ : Shortest available term for requested symbol. */ horizon?: number | null | undefined; /** * 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; /** * Which rollover method to use. _Default value_ : hist_vol */ rolloverType?: string | null | undefined; }; /** @internal */ export const GetLongTermForecastRequest$inboundSchema: z.ZodType< GetLongTermForecastRequest, z.ZodTypeDef, unknown > = z.object({ symbol: z.string(), horizon: z.nullable(z.number().int()).optional(), start_date: z.nullable(z.string()).optional(), end_date: z.nullable(z.string()).optional(), rollover_type: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "start_date": "startDate", "end_date": "endDate", "rollover_type": "rolloverType", }); }); /** @internal */ export type GetLongTermForecastRequest$Outbound = { symbol: string; horizon?: number | null | undefined; start_date?: string | null | undefined; end_date?: string | null | undefined; rollover_type?: string | null | undefined; }; /** @internal */ export const GetLongTermForecastRequest$outboundSchema: z.ZodType< GetLongTermForecastRequest$Outbound, z.ZodTypeDef, GetLongTermForecastRequest > = z.object({ symbol: z.string(), horizon: z.nullable(z.number().int()).optional(), startDate: z.nullable(z.string()).optional(), endDate: z.nullable(z.string()).optional(), rolloverType: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { startDate: "start_date", endDate: "end_date", rolloverType: "rollover_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLongTermForecastRequest$ { /** @deprecated use `GetLongTermForecastRequest$inboundSchema` instead. */ export const inboundSchema = GetLongTermForecastRequest$inboundSchema; /** @deprecated use `GetLongTermForecastRequest$outboundSchema` instead. */ export const outboundSchema = GetLongTermForecastRequest$outboundSchema; /** @deprecated use `GetLongTermForecastRequest$Outbound` instead. */ export type Outbound = GetLongTermForecastRequest$Outbound; } export function getLongTermForecastRequestToJSON( getLongTermForecastRequest: GetLongTermForecastRequest, ): string { return JSON.stringify( GetLongTermForecastRequest$outboundSchema.parse(getLongTermForecastRequest), ); } export function getLongTermForecastRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLongTermForecastRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLongTermForecastRequest' from JSON`, ); }