/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ListDocument, ListDocument$inboundSchema, ListDocument$Outbound, ListDocument$outboundSchema, } from "./listdocument.js"; export type ListPaginatedDocumentsResponse = { documents: Array; /** * The cursor to use for pagination */ nextCursor?: string | null | undefined; }; /** @internal */ export const ListPaginatedDocumentsResponse$inboundSchema: z.ZodType< ListPaginatedDocumentsResponse, z.ZodTypeDef, unknown > = z.object({ documents: z.array(ListDocument$inboundSchema), next_cursor: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "next_cursor": "nextCursor", }); }); /** @internal */ export type ListPaginatedDocumentsResponse$Outbound = { documents: Array; next_cursor?: string | null | undefined; }; /** @internal */ export const ListPaginatedDocumentsResponse$outboundSchema: z.ZodType< ListPaginatedDocumentsResponse$Outbound, z.ZodTypeDef, ListPaginatedDocumentsResponse > = z.object({ documents: z.array(ListDocument$outboundSchema), nextCursor: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { nextCursor: "next_cursor", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListPaginatedDocumentsResponse$ { /** @deprecated use `ListPaginatedDocumentsResponse$inboundSchema` instead. */ export const inboundSchema = ListPaginatedDocumentsResponse$inboundSchema; /** @deprecated use `ListPaginatedDocumentsResponse$outboundSchema` instead. */ export const outboundSchema = ListPaginatedDocumentsResponse$outboundSchema; /** @deprecated use `ListPaginatedDocumentsResponse$Outbound` instead. */ export type Outbound = ListPaginatedDocumentsResponse$Outbound; } export function listPaginatedDocumentsResponseToJSON( listPaginatedDocumentsResponse: ListPaginatedDocumentsResponse, ): string { return JSON.stringify( ListPaginatedDocumentsResponse$outboundSchema.parse( listPaginatedDocumentsResponse, ), ); } export function listPaginatedDocumentsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListPaginatedDocumentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListPaginatedDocumentsResponse' from JSON`, ); }