/* * 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"; import { IndicatorTick, IndicatorTick$inboundSchema, IndicatorTick$Outbound, IndicatorTick$outboundSchema, } from "./indicatortick.js"; export type Indicator = { name: string; series: Array; }; /** @internal */ export const Indicator$inboundSchema: z.ZodType< Indicator, z.ZodTypeDef, unknown > = z.object({ name: z.string(), series: z.array(IndicatorTick$inboundSchema), }); /** @internal */ export type Indicator$Outbound = { name: string; series: Array; }; /** @internal */ export const Indicator$outboundSchema: z.ZodType< Indicator$Outbound, z.ZodTypeDef, Indicator > = z.object({ name: z.string(), series: z.array(IndicatorTick$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Indicator$ { /** @deprecated use `Indicator$inboundSchema` instead. */ export const inboundSchema = Indicator$inboundSchema; /** @deprecated use `Indicator$outboundSchema` instead. */ export const outboundSchema = Indicator$outboundSchema; /** @deprecated use `Indicator$Outbound` instead. */ export type Outbound = Indicator$Outbound; } export function indicatorToJSON(indicator: Indicator): string { return JSON.stringify(Indicator$outboundSchema.parse(indicator)); } export function indicatorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Indicator$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Indicator' from JSON`, ); }