/* * 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 GetModelOutputRequest = { /** * Future symbol */ symbol: string; /** * Model name. */ model?: string | 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; }; /** @internal */ export const GetModelOutputRequest$inboundSchema: z.ZodType< GetModelOutputRequest, z.ZodTypeDef, unknown > = z.object({ symbol: z.string(), model: z.nullable(z.string()).optional(), start_date: z.nullable(z.string()).optional(), end_date: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "start_date": "startDate", "end_date": "endDate", }); }); /** @internal */ export type GetModelOutputRequest$Outbound = { symbol: string; model?: string | null | undefined; start_date?: string | null | undefined; end_date?: string | null | undefined; }; /** @internal */ export const GetModelOutputRequest$outboundSchema: z.ZodType< GetModelOutputRequest$Outbound, z.ZodTypeDef, GetModelOutputRequest > = z.object({ symbol: z.string(), model: z.nullable(z.string()).optional(), startDate: z.nullable(z.string()).optional(), endDate: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { startDate: "start_date", endDate: "end_date", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetModelOutputRequest$ { /** @deprecated use `GetModelOutputRequest$inboundSchema` instead. */ export const inboundSchema = GetModelOutputRequest$inboundSchema; /** @deprecated use `GetModelOutputRequest$outboundSchema` instead. */ export const outboundSchema = GetModelOutputRequest$outboundSchema; /** @deprecated use `GetModelOutputRequest$Outbound` instead. */ export type Outbound = GetModelOutputRequest$Outbound; } export function getModelOutputRequestToJSON( getModelOutputRequest: GetModelOutputRequest, ): string { return JSON.stringify( GetModelOutputRequest$outboundSchema.parse(getModelOutputRequest), ); } export function getModelOutputRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetModelOutputRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetModelOutputRequest' from JSON`, ); }