/* * 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"; export type ListDocumentsRequest = { /** * The name of the index to list documents for */ indexName: string; /** * A cursor to fetch the next set of documents if the list is paginated */ cursor?: string | undefined; }; /** @internal */ export const ListDocumentsRequest$inboundSchema: z.ZodType< ListDocumentsRequest, z.ZodTypeDef, unknown > = z.object({ index_name: z.string(), cursor: z.string().optional(), }).transform((v) => { return remap$(v, { "index_name": "indexName", }); }); /** @internal */ export type ListDocumentsRequest$Outbound = { index_name: string; cursor?: string | undefined; }; /** @internal */ export const ListDocumentsRequest$outboundSchema: z.ZodType< ListDocumentsRequest$Outbound, z.ZodTypeDef, ListDocumentsRequest > = z.object({ indexName: z.string(), cursor: z.string().optional(), }).transform((v) => { return remap$(v, { indexName: "index_name", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListDocumentsRequest$ { /** @deprecated use `ListDocumentsRequest$inboundSchema` instead. */ export const inboundSchema = ListDocumentsRequest$inboundSchema; /** @deprecated use `ListDocumentsRequest$outboundSchema` instead. */ export const outboundSchema = ListDocumentsRequest$outboundSchema; /** @deprecated use `ListDocumentsRequest$Outbound` instead. */ export type Outbound = ListDocumentsRequest$Outbound; } export function listDocumentsRequestToJSON( listDocumentsRequest: ListDocumentsRequest, ): string { return JSON.stringify( ListDocumentsRequest$outboundSchema.parse(listDocumentsRequest), ); } export function listDocumentsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListDocumentsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListDocumentsRequest' from JSON`, ); }