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

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

export type GetTraces = {
  traces: FeedResultGetTrace;
};

/** @internal */
export const GetTraces$inboundSchema: z.ZodType<GetTraces, unknown> = z.object({
  traces: FeedResultGetTrace$inboundSchema,
});

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