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

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 {
  JudgeClassificationOutputOption,
  JudgeClassificationOutputOption$inboundSchema,
  JudgeClassificationOutputOption$Outbound,
  JudgeClassificationOutputOption$outboundSchema,
} from "./judgeclassificationoutputoption.js";

export type JudgeClassificationOutput = {
  type: "CLASSIFICATION";
  options: Array<JudgeClassificationOutputOption>;
};

/** @internal */
export const JudgeClassificationOutput$inboundSchema: z.ZodType<
  JudgeClassificationOutput,
  unknown
> = z.object({
  type: z.literal("CLASSIFICATION"),
  options: z.array(JudgeClassificationOutputOption$inboundSchema),
});
/** @internal */
export type JudgeClassificationOutput$Outbound = {
  type: "CLASSIFICATION";
  options: Array<JudgeClassificationOutputOption$Outbound>;
};

/** @internal */
export const JudgeClassificationOutput$outboundSchema: z.ZodType<
  JudgeClassificationOutput$Outbound,
  JudgeClassificationOutput
> = z.object({
  type: z.literal("CLASSIFICATION"),
  options: z.array(JudgeClassificationOutputOption$outboundSchema),
});

export function judgeClassificationOutputToJSON(
  judgeClassificationOutput: JudgeClassificationOutput,
): string {
  return JSON.stringify(
    JudgeClassificationOutput$outboundSchema.parse(judgeClassificationOutput),
  );
}
export function judgeClassificationOutputFromJSON(
  jsonString: string,
): SafeParseResult<JudgeClassificationOutput, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => JudgeClassificationOutput$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'JudgeClassificationOutput' from JSON`,
  );
}
