/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { IndexTextRequest, IndexTextRequest$inboundSchema, IndexTextRequest$Outbound, IndexTextRequest$outboundSchema, } from "./indextextrequest.js"; export type BatchIndexTextRequest = { documents: Array; }; /** @internal */ export const BatchIndexTextRequest$inboundSchema: z.ZodType< BatchIndexTextRequest, z.ZodTypeDef, unknown > = z.object({ documents: z.array(IndexTextRequest$inboundSchema), }); /** @internal */ export type BatchIndexTextRequest$Outbound = { documents: Array; }; /** @internal */ export const BatchIndexTextRequest$outboundSchema: z.ZodType< BatchIndexTextRequest$Outbound, z.ZodTypeDef, BatchIndexTextRequest > = z.object({ documents: z.array(IndexTextRequest$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BatchIndexTextRequest$ { /** @deprecated use `BatchIndexTextRequest$inboundSchema` instead. */ export const inboundSchema = BatchIndexTextRequest$inboundSchema; /** @deprecated use `BatchIndexTextRequest$outboundSchema` instead. */ export const outboundSchema = BatchIndexTextRequest$outboundSchema; /** @deprecated use `BatchIndexTextRequest$Outbound` instead. */ export type Outbound = BatchIndexTextRequest$Outbound; } export function batchIndexTextRequestToJSON( batchIndexTextRequest: BatchIndexTextRequest, ): string { return JSON.stringify( BatchIndexTextRequest$outboundSchema.parse(batchIndexTextRequest), ); } export function batchIndexTextRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BatchIndexTextRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchIndexTextRequest' from JSON`, ); }