/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 908fbd640ca2
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { ProcessStatus$inboundSchema } from "./processstatus.js";
/** @internal */
export const Document$inboundSchema = z.object({
    id: z.string(),
    library_id: z.string(),
    hash: z.nullable(z.string()),
    mime_type: z.nullable(z.string()),
    extension: z.nullable(z.string()),
    size: z.nullable(z.int()),
    name: z.string(),
    summary: z.nullable(z.string()).optional(),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
    last_processed_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
    number_of_pages: z.nullable(z.int()).optional(),
    process_status: ProcessStatus$inboundSchema,
    uploaded_by_id: z.nullable(z.string()),
    uploaded_by_type: z.string(),
    tokens_processing_main_content: z.nullable(z.int()).optional(),
    tokens_processing_summary: z.nullable(z.int()).optional(),
    url: z.nullable(z.string()).optional(),
    attributes: z.nullable(z.record(z.string(), z.any())).optional(),
    expires_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
    processing_status: z.string(),
    tokens_processing_total: z.int(),
}).transform((v) => {
    return remap$(v, {
        "library_id": "libraryId",
        "mime_type": "mimeType",
        "created_at": "createdAt",
        "last_processed_at": "lastProcessedAt",
        "number_of_pages": "numberOfPages",
        "process_status": "processStatus",
        "uploaded_by_id": "uploadedById",
        "uploaded_by_type": "uploadedByType",
        "tokens_processing_main_content": "tokensProcessingMainContent",
        "tokens_processing_summary": "tokensProcessingSummary",
        "expires_at": "expiresAt",
        "processing_status": "processingStatus",
        "tokens_processing_total": "tokensProcessingTotal",
    });
});
export function documentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Document$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Document' from JSON`);
}
//# sourceMappingURL=document.js.map