/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; /** * File processing status counts. */ export type FileCounts = { /** * The number of files that are currently being processed. */ inProgress: number; /** * The number of files that have been successfully processed. */ completed: number; /** * The number of files that have failed to process. */ failed: number; /** * The number of files that were cancelled. */ cancelled: number; /** * The total number of files. */ total: number; }; /** @internal */ export const FileCounts$inboundSchema: z.ZodType< FileCounts, z.ZodTypeDef, unknown > = z.object({ in_progress: z.number().int(), completed: z.number().int(), failed: z.number().int(), cancelled: z.number().int(), total: z.number().int(), }).transform((v) => { return remap$(v, { "in_progress": "inProgress", }); }); /** @internal */ export type FileCounts$Outbound = { in_progress: number; completed: number; failed: number; cancelled: number; total: number; }; /** @internal */ export const FileCounts$outboundSchema: z.ZodType< FileCounts$Outbound, z.ZodTypeDef, FileCounts > = z.object({ inProgress: z.number().int(), completed: z.number().int(), failed: z.number().int(), cancelled: z.number().int(), total: z.number().int(), }).transform((v) => { return remap$(v, { inProgress: "in_progress", }); }); export function fileCountsToJSON(fileCounts: FileCounts): string { return JSON.stringify(FileCounts$outboundSchema.parse(fileCounts)); } export function fileCountsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileCounts$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileCounts' from JSON`, ); }