/* * 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 ListDocument = { /** * The ID of the indexed document */ docId: string; /** * Title of the document */ title?: string | undefined; /** * URL associated with the document */ url?: string | null | undefined; }; /** @internal */ export const ListDocument$inboundSchema: z.ZodType< ListDocument, z.ZodTypeDef, unknown > = z.object({ doc_id: z.string(), title: z.string().optional(), url: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "doc_id": "docId", }); }); /** @internal */ export type ListDocument$Outbound = { doc_id: string; title?: string | undefined; url?: string | null | undefined; }; /** @internal */ export const ListDocument$outboundSchema: z.ZodType< ListDocument$Outbound, z.ZodTypeDef, ListDocument > = z.object({ docId: z.string(), title: z.string().optional(), url: z.nullable(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 ListDocument$ { /** @deprecated use `ListDocument$inboundSchema` instead. */ export const inboundSchema = ListDocument$inboundSchema; /** @deprecated use `ListDocument$outboundSchema` instead. */ export const outboundSchema = ListDocument$outboundSchema; /** @deprecated use `ListDocument$Outbound` instead. */ export type Outbound = ListDocument$Outbound; } export function listDocumentToJSON(listDocument: ListDocument): string { return JSON.stringify(ListDocument$outboundSchema.parse(listDocument)); } export function listDocumentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListDocument$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListDocument' from JSON`, ); }