/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c087accad4e2 */ import * as z from "zod/v4"; 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 OCRTableBlock = { topLeftX: number; topLeftY: number; bottomRightX: number; bottomRightY: number; /** * Text/markdown/html content of this block */ content: string; type: "table"; /** * References the corresponding entry in OCRPageObject.tables, when tables are extracted */ tableId?: string | null | undefined; }; /** @internal */ export const OCRTableBlock$inboundSchema: z.ZodType = z .object({ top_left_x: z.int(), top_left_y: z.int(), bottom_right_x: z.int(), bottom_right_y: z.int(), content: z.string(), type: z.literal("table"), table_id: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "top_left_x": "topLeftX", "top_left_y": "topLeftY", "bottom_right_x": "bottomRightX", "bottom_right_y": "bottomRightY", "table_id": "tableId", }); }); export function ocrTableBlockFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OCRTableBlock$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OCRTableBlock' from JSON`, ); }