/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f58750aee44d */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DocumentOrErrorUnion, DocumentOrErrorUnion$inboundSchema, } from "./documentorerrorunion.js"; export type GetDocumentsResponse = { /** * The document details or the error if document is not found. */ documents?: { [k: string]: DocumentOrErrorUnion } | undefined; }; /** @internal */ export const GetDocumentsResponse$inboundSchema: z.ZodType< GetDocumentsResponse, z.ZodTypeDef, unknown > = z.object({ documents: z.record(DocumentOrErrorUnion$inboundSchema).optional(), }); export function getDocumentsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetDocumentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDocumentsResponse' from JSON`, ); }