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

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

export type GetSpanEvaluationFields = {
  fieldDefinitions: Array<OtelFieldDefinition>;
};

/** @internal */
export const GetSpanEvaluationFields$inboundSchema: z.ZodType<
  GetSpanEvaluationFields,
  unknown
> = z.object({
  field_definitions: z.array(OtelFieldDefinition$inboundSchema),
}).transform((v) => {
  return remap$(v, {
    "field_definitions": "fieldDefinitions",
  });
});

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