/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 684d4885f374
 */

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";
import { ProcessStatus, ProcessStatus$inboundSchema } from "./processstatus.js";

export type ProcessingStatus = {
  documentId: string;
  processStatus: ProcessStatus;
  /**
   * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
   */
  processingStatus: string;
};

/** @internal */
export const ProcessingStatus$inboundSchema: z.ZodType<
  ProcessingStatus,
  unknown
> = z.object({
  document_id: z.string(),
  process_status: ProcessStatus$inboundSchema,
  processing_status: z.string(),
}).transform((v) => {
  return remap$(v, {
    "document_id": "documentId",
    "process_status": "processStatus",
    "processing_status": "processingStatus",
  });
});

export function processingStatusFromJSON(
  jsonString: string,
): SafeParseResult<ProcessingStatus, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ProcessingStatus$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ProcessingStatus' from JSON`,
  );
}
