/* * 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 { Document, Document$inboundSchema, Document$Outbound, Document$outboundSchema, } from "./document.js"; import { Pagination, Pagination$inboundSchema, Pagination$Outbound, Pagination$outboundSchema, } from "./pagination.js"; export type DocumentList = { pagination: Pagination; documents: Array; }; /** @internal */ export const DocumentList$inboundSchema: z.ZodType< DocumentList, z.ZodTypeDef, unknown > = z.object({ pagination: Pagination$inboundSchema, documents: z.array(Document$inboundSchema), }); /** @internal */ export type DocumentList$Outbound = { pagination: Pagination$Outbound; documents: Array; }; /** @internal */ export const DocumentList$outboundSchema: z.ZodType< DocumentList$Outbound, z.ZodTypeDef, DocumentList > = z.object({ pagination: Pagination$outboundSchema, documents: z.array(Document$outboundSchema), }); export function documentListToJSON(documentList: DocumentList): string { return JSON.stringify(DocumentList$outboundSchema.parse(documentList)); } export function documentListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DocumentList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DocumentList' from JSON`, ); }