/* * 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 DeleteDocumentRequest = { /** * The unique ID of the document to delete */ docId: string; /** * The name of the index containing the document */ indexName: string; }; /** @internal */ export const DeleteDocumentRequest$inboundSchema: z.ZodType< DeleteDocumentRequest, z.ZodTypeDef, unknown > = z.object({ doc_id: z.string(), index_name: z.string(), }).transform((v) => { return remap$(v, { "doc_id": "docId", "index_name": "indexName", }); }); /** @internal */ export type DeleteDocumentRequest$Outbound = { doc_id: string; index_name: string; }; /** @internal */ export const DeleteDocumentRequest$outboundSchema: z.ZodType< DeleteDocumentRequest$Outbound, z.ZodTypeDef, DeleteDocumentRequest > = z.object({ docId: z.string(), indexName: z.string(), }).transform((v) => { return remap$(v, { docId: "doc_id", 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 DeleteDocumentRequest$ { /** @deprecated use `DeleteDocumentRequest$inboundSchema` instead. */ export const inboundSchema = DeleteDocumentRequest$inboundSchema; /** @deprecated use `DeleteDocumentRequest$outboundSchema` instead. */ export const outboundSchema = DeleteDocumentRequest$outboundSchema; /** @deprecated use `DeleteDocumentRequest$Outbound` instead. */ export type Outbound = DeleteDocumentRequest$Outbound; } export function deleteDocumentRequestToJSON( deleteDocumentRequest: DeleteDocumentRequest, ): string { return JSON.stringify( DeleteDocumentRequest$outboundSchema.parse(deleteDocumentRequest), ); } export function deleteDocumentRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteDocumentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteDocumentRequest' from JSON`, ); }