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