/* * 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"; import { StrategyTrajectoryHorizonResponse, StrategyTrajectoryHorizonResponse$inboundSchema, StrategyTrajectoryHorizonResponse$Outbound, StrategyTrajectoryHorizonResponse$outboundSchema, } from "./strategytrajectoryhorizonresponse.js"; export type StrategyTrajectoryResponse = { id: string; createdAt: string | null; updatedAt: string | null; startDate: string | null; endDate: string | null; priceCollarSigma: number | null; estimateUncertainty: boolean | null; interpolate: boolean | null; getMarketDrivers: boolean | null; getMovingAverages: boolean | null; strategyId: string; horizons?: Array | null | undefined; }; /** @internal */ export const StrategyTrajectoryResponse$inboundSchema: z.ZodType< StrategyTrajectoryResponse, z.ZodTypeDef, unknown > = z.object({ id: z.string(), created_at: z.nullable(z.string()), updated_at: z.nullable(z.string()), start_date: z.nullable(z.string()), end_date: z.nullable(z.string()), price_collar_sigma: z.nullable(z.number().int()), estimate_uncertainty: z.nullable(z.boolean()), interpolate: z.nullable(z.boolean()), get_market_drivers: z.nullable(z.boolean()), get_moving_averages: z.nullable(z.boolean()), strategy_id: z.string(), horizons: z.nullable(z.array(StrategyTrajectoryHorizonResponse$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "updated_at": "updatedAt", "start_date": "startDate", "end_date": "endDate", "price_collar_sigma": "priceCollarSigma", "estimate_uncertainty": "estimateUncertainty", "get_market_drivers": "getMarketDrivers", "get_moving_averages": "getMovingAverages", "strategy_id": "strategyId", }); }); /** @internal */ export type StrategyTrajectoryResponse$Outbound = { id: string; created_at: string | null; updated_at: string | null; start_date: string | null; end_date: string | null; price_collar_sigma: number | null; estimate_uncertainty: boolean | null; interpolate: boolean | null; get_market_drivers: boolean | null; get_moving_averages: boolean | null; strategy_id: string; horizons?: | Array | null | undefined; }; /** @internal */ export const StrategyTrajectoryResponse$outboundSchema: z.ZodType< StrategyTrajectoryResponse$Outbound, z.ZodTypeDef, StrategyTrajectoryResponse > = z.object({ id: z.string(), createdAt: z.nullable(z.string()), updatedAt: z.nullable(z.string()), startDate: z.nullable(z.string()), endDate: z.nullable(z.string()), priceCollarSigma: z.nullable(z.number().int()), estimateUncertainty: z.nullable(z.boolean()), interpolate: z.nullable(z.boolean()), getMarketDrivers: z.nullable(z.boolean()), getMovingAverages: z.nullable(z.boolean()), strategyId: z.string(), horizons: z.nullable( z.array(StrategyTrajectoryHorizonResponse$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { createdAt: "created_at", updatedAt: "updated_at", startDate: "start_date", endDate: "end_date", priceCollarSigma: "price_collar_sigma", estimateUncertainty: "estimate_uncertainty", getMarketDrivers: "get_market_drivers", getMovingAverages: "get_moving_averages", strategyId: "strategy_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace StrategyTrajectoryResponse$ { /** @deprecated use `StrategyTrajectoryResponse$inboundSchema` instead. */ export const inboundSchema = StrategyTrajectoryResponse$inboundSchema; /** @deprecated use `StrategyTrajectoryResponse$outboundSchema` instead. */ export const outboundSchema = StrategyTrajectoryResponse$outboundSchema; /** @deprecated use `StrategyTrajectoryResponse$Outbound` instead. */ export type Outbound = StrategyTrajectoryResponse$Outbound; } export function strategyTrajectoryResponseToJSON( strategyTrajectoryResponse: StrategyTrajectoryResponse, ): string { return JSON.stringify( StrategyTrajectoryResponse$outboundSchema.parse(strategyTrajectoryResponse), ); } export function strategyTrajectoryResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StrategyTrajectoryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StrategyTrajectoryResponse' from JSON`, ); }