/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 87a573efa206 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { FacetResult, FacetResult$inboundSchema } from "./facetresult.js"; import { FeedResult, FeedResult$inboundSchema } from "./feedresult.js"; export type FeedResponse = { /** * List of experiment ids for the corresponding request. */ experimentIds?: Array | undefined; /** * An opaque token that represents this particular feed response. */ trackingToken?: string | undefined; /** * Server unix timestamp (in seconds since epoch UTC). */ serverTimestamp: number; results?: Array | undefined; /** * Map from category to the list of facets that can be used to filter the entry's content. */ facetResults?: { [k: string]: Array } | undefined; /** * The time window (in hours) used for generating user mentions. */ mentionsTimeWindowInHours?: number | undefined; }; /** @internal */ export const FeedResponse$inboundSchema: z.ZodType< FeedResponse, z.ZodTypeDef, unknown > = z.object({ experimentIds: z.array(z.number().int()).optional(), trackingToken: z.string().optional(), serverTimestamp: z.number().int(), results: z.array(FeedResult$inboundSchema).optional(), facetResults: z.record(z.array(FacetResult$inboundSchema)).optional(), mentionsTimeWindowInHours: z.number().int().optional(), }); export function feedResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeedResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeedResponse' from JSON`, ); }