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

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

export type FeedResultGetTrace = {
  results?: Array<GetTrace> | undefined;
  next?: string | null | undefined;
  cursor?: string | null | undefined;
};

/** @internal */
export const FeedResultGetTrace$inboundSchema: z.ZodType<
  FeedResultGetTrace,
  unknown
> = z.object({
  results: z.array(GetTrace$inboundSchema).optional(),
  next: z.nullable(z.string()).optional(),
  cursor: z.nullable(z.string()).optional(),
});

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