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

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

export type ListDatasetRecordsResponse = {
  records: PaginatedResultDatasetRecord;
};

/** @internal */
export const ListDatasetRecordsResponse$inboundSchema: z.ZodType<
  ListDatasetRecordsResponse,
  unknown
> = z.object({
  records: PaginatedResultDatasetRecord$inboundSchema,
});

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