/* * 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 { SectorIndexHistoricalData, SectorIndexHistoricalData$inboundSchema, SectorIndexHistoricalData$Outbound, SectorIndexHistoricalData$outboundSchema, } from "./sectorindexhistoricaldata.js"; export type GetSectorIndexHistoricalResponse = { success?: true | undefined; data: Array; }; /** @internal */ export const GetSectorIndexHistoricalResponse$inboundSchema: z.ZodType< GetSectorIndexHistoricalResponse, z.ZodTypeDef, unknown > = z.object({ success: z.literal(true).default(true).optional(), data: z.array(SectorIndexHistoricalData$inboundSchema), }); /** @internal */ export type GetSectorIndexHistoricalResponse$Outbound = { success: true; data: Array; }; /** @internal */ export const GetSectorIndexHistoricalResponse$outboundSchema: z.ZodType< GetSectorIndexHistoricalResponse$Outbound, z.ZodTypeDef, GetSectorIndexHistoricalResponse > = z.object({ success: z.literal(true).default(true as const), data: z.array(SectorIndexHistoricalData$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetSectorIndexHistoricalResponse$ { /** @deprecated use `GetSectorIndexHistoricalResponse$inboundSchema` instead. */ export const inboundSchema = GetSectorIndexHistoricalResponse$inboundSchema; /** @deprecated use `GetSectorIndexHistoricalResponse$outboundSchema` instead. */ export const outboundSchema = GetSectorIndexHistoricalResponse$outboundSchema; /** @deprecated use `GetSectorIndexHistoricalResponse$Outbound` instead. */ export type Outbound = GetSectorIndexHistoricalResponse$Outbound; } export function getSectorIndexHistoricalResponseToJSON( getSectorIndexHistoricalResponse: GetSectorIndexHistoricalResponse, ): string { return JSON.stringify( GetSectorIndexHistoricalResponse$outboundSchema.parse( getSectorIndexHistoricalResponse, ), ); } export function getSectorIndexHistoricalResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetSectorIndexHistoricalResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSectorIndexHistoricalResponse' from JSON`, ); }