/* * 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 DocumentIndexedResponse = { /** * The ID of the indexed document */ docId?: string | undefined; }; /** @internal */ export const DocumentIndexedResponse$inboundSchema: z.ZodType< DocumentIndexedResponse, z.ZodTypeDef, unknown > = z.object({ doc_id: z.string().optional(), }).transform((v) => { return remap$(v, { "doc_id": "docId", }); }); /** @internal */ export type DocumentIndexedResponse$Outbound = { doc_id?: string | undefined; }; /** @internal */ export const DocumentIndexedResponse$outboundSchema: z.ZodType< DocumentIndexedResponse$Outbound, z.ZodTypeDef, DocumentIndexedResponse > = z.object({ docId: z.string().optional(), }).transform((v) => { return remap$(v, { docId: "doc_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DocumentIndexedResponse$ { /** @deprecated use `DocumentIndexedResponse$inboundSchema` instead. */ export const inboundSchema = DocumentIndexedResponse$inboundSchema; /** @deprecated use `DocumentIndexedResponse$outboundSchema` instead. */ export const outboundSchema = DocumentIndexedResponse$outboundSchema; /** @deprecated use `DocumentIndexedResponse$Outbound` instead. */ export type Outbound = DocumentIndexedResponse$Outbound; } export function documentIndexedResponseToJSON( documentIndexedResponse: DocumentIndexedResponse, ): string { return JSON.stringify( DocumentIndexedResponse$outboundSchema.parse(documentIndexedResponse), ); } export function documentIndexedResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DocumentIndexedResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DocumentIndexedResponse' from JSON`, ); }