/* * 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 SectorIndexTick = { date: RFCDate; value: number; }; /** @internal */ export const SectorIndexTick$inboundSchema: z.ZodType< SectorIndexTick, z.ZodTypeDef, unknown > = z.object({ date: z.string().transform(v => new RFCDate(v)), value: z.number(), }); /** @internal */ export type SectorIndexTick$Outbound = { date: string; value: number; }; /** @internal */ export const SectorIndexTick$outboundSchema: z.ZodType< SectorIndexTick$Outbound, z.ZodTypeDef, SectorIndexTick > = 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 SectorIndexTick$ { /** @deprecated use `SectorIndexTick$inboundSchema` instead. */ export const inboundSchema = SectorIndexTick$inboundSchema; /** @deprecated use `SectorIndexTick$outboundSchema` instead. */ export const outboundSchema = SectorIndexTick$outboundSchema; /** @deprecated use `SectorIndexTick$Outbound` instead. */ export type Outbound = SectorIndexTick$Outbound; } export function sectorIndexTickToJSON( sectorIndexTick: SectorIndexTick, ): string { return JSON.stringify(SectorIndexTick$outboundSchema.parse(sectorIndexTick)); } export function sectorIndexTickFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SectorIndexTick$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SectorIndexTick' from JSON`, ); }