/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 8713bc955187 */ 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 { Document, Document$inboundSchema } from "./document.js"; export type GetDocumentsByFacetsResponse = { /** * The document details, ordered by score. */ documents?: Array | undefined; /** * Whether more results are available. Use cursor to retrieve them. */ hasMoreResults?: boolean | undefined; /** * Cursor that indicates the start of the next page of results. To be passed in "more" requests for this query. */ cursor?: string | undefined; }; /** @internal */ export const GetDocumentsByFacetsResponse$inboundSchema: z.ZodType< GetDocumentsByFacetsResponse, z.ZodTypeDef, unknown > = z.object({ documents: z.array(Document$inboundSchema).optional(), hasMoreResults: z.boolean().optional(), cursor: z.string().optional(), }); export function getDocumentsByFacetsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetDocumentsByFacetsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDocumentsByFacetsResponse' from JSON`, ); }