/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 1fe62326946b */ import * as z from "zod/v3"; import { DocumentDefinition, DocumentDefinition$Outbound, DocumentDefinition$outboundSchema, } from "./documentdefinition.js"; /** * Describes the request body of the /bulkindexdocuments API call */ export type BulkIndexDocumentsRequest = { /** * Unique id that must be used for this bulk upload instance */ uploadId: string; /** * true if this is the first page of the upload. Defaults to false */ isFirstPage?: boolean | undefined; /** * true if this is the last page of the upload. Defaults to false */ isLastPage?: boolean | undefined; /** * Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true */ forceRestartUpload?: boolean | undefined; /** * Datasource of the documents */ datasource: string; /** * Batch of documents for the datasource */ documents: Array; /** * True if older documents need to be force deleted after the upload completes. Defaults to older documents being deleted asynchronously. This must only be set when `isLastPage = true` */ disableStaleDocumentDeletionCheck?: boolean | undefined; }; /** @internal */ export type BulkIndexDocumentsRequest$Outbound = { uploadId: string; isFirstPage?: boolean | undefined; isLastPage?: boolean | undefined; forceRestartUpload?: boolean | undefined; datasource: string; documents: Array; disableStaleDocumentDeletionCheck?: boolean | undefined; }; /** @internal */ export const BulkIndexDocumentsRequest$outboundSchema: z.ZodType< BulkIndexDocumentsRequest$Outbound, z.ZodTypeDef, BulkIndexDocumentsRequest > = z.object({ uploadId: z.string(), isFirstPage: z.boolean().optional(), isLastPage: z.boolean().optional(), forceRestartUpload: z.boolean().optional(), datasource: z.string(), documents: z.array(DocumentDefinition$outboundSchema), disableStaleDocumentDeletionCheck: z.boolean().optional(), }); export function bulkIndexDocumentsRequestToJSON( bulkIndexDocumentsRequest: BulkIndexDocumentsRequest, ): string { return JSON.stringify( BulkIndexDocumentsRequest$outboundSchema.parse(bulkIndexDocumentsRequest), ); }