/* * 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 { RFCDate } from "../../types/rfcdate.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type IndicatorTick = { date: RFCDate; value: number; }; /** @internal */ export const IndicatorTick$inboundSchema: z.ZodType< IndicatorTick, z.ZodTypeDef, unknown > = z.object({ date: z.string().transform(v => new RFCDate(v)), value: z.number(), }); /** @internal */ export type IndicatorTick$Outbound = { date: string; value: number; }; /** @internal */ export const IndicatorTick$outboundSchema: z.ZodType< IndicatorTick$Outbound, z.ZodTypeDef, IndicatorTick > = z.object({ date: z.instanceof(RFCDate).transform(v => v.toString()), value: z.number(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IndicatorTick$ { /** @deprecated use `IndicatorTick$inboundSchema` instead. */ export const inboundSchema = IndicatorTick$inboundSchema; /** @deprecated use `IndicatorTick$outboundSchema` instead. */ export const outboundSchema = IndicatorTick$outboundSchema; /** @deprecated use `IndicatorTick$Outbound` instead. */ export type Outbound = IndicatorTick$Outbound; } export function indicatorTickToJSON(indicatorTick: IndicatorTick): string { return JSON.stringify(IndicatorTick$outboundSchema.parse(indicatorTick)); } export function indicatorTickFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IndicatorTick$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IndicatorTick' from JSON`, ); }