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

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";

export type BatchExecutionResult = {
  /**
   * Status of the operation (success/failure)
   */
  status: string;
  /**
   * Error message if operation failed
   */
  error?: string | null | undefined;
};

/** @internal */
export const BatchExecutionResult$inboundSchema: z.ZodType<
  BatchExecutionResult,
  unknown
> = z.object({
  status: z.string(),
  error: z.nullable(z.string()).optional(),
});

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