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

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 {
  FeedResultGetSpanEvaluation,
  FeedResultGetSpanEvaluation$inboundSchema,
} from "./feedresultgetspanevaluation.js";

export type GetSpanEvaluations = {
  spanEvaluations: FeedResultGetSpanEvaluation;
};

/** @internal */
export const GetSpanEvaluations$inboundSchema: z.ZodType<
  GetSpanEvaluations,
  unknown
> = z.object({
  span_evaluations: FeedResultGetSpanEvaluation$inboundSchema,
}).transform((v) => {
  return remap$(v, {
    "span_evaluations": "spanEvaluations",
  });
});

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