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

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import { BatchJob, BatchJob$inboundSchema } from "./batchjob.js";

export type ListBatchJobsResponse = {
  data?: Array<BatchJob> | undefined;
  object: "list";
  total: number;
};

/** @internal */
export const ListBatchJobsResponse$inboundSchema: z.ZodType<
  ListBatchJobsResponse,
  unknown
> = z.object({
  data: z.array(BatchJob$inboundSchema).optional(),
  object: z.literal("list").default("list"),
  total: z.int(),
});

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