/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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 { DocumentChunk, DocumentChunk$inboundSchema, DocumentChunk$Outbound, DocumentChunk$outboundSchema, } from "./documentchunk.js"; import { Pagination, Pagination$inboundSchema, Pagination$Outbound, Pagination$outboundSchema, } from "./pagination.js"; export type DocumentChunkList = { pagination: Pagination; chunks: Array; }; /** @internal */ export const DocumentChunkList$inboundSchema: z.ZodType< DocumentChunkList, z.ZodTypeDef, unknown > = z.object({ pagination: Pagination$inboundSchema, chunks: z.array(DocumentChunk$inboundSchema), }); /** @internal */ export type DocumentChunkList$Outbound = { pagination: Pagination$Outbound; chunks: Array; }; /** @internal */ export const DocumentChunkList$outboundSchema: z.ZodType< DocumentChunkList$Outbound, z.ZodTypeDef, DocumentChunkList > = z.object({ pagination: Pagination$outboundSchema, chunks: z.array(DocumentChunk$outboundSchema), }); export function documentChunkListToJSON( documentChunkList: DocumentChunkList, ): string { return JSON.stringify( DocumentChunkList$outboundSchema.parse(documentChunkList), ); } export function documentChunkListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DocumentChunkList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DocumentChunkList' from JSON`, ); }