/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Comment, Comment$inboundSchema } from "./comment.js"; import { PageInfo, PageInfo$inboundSchema } from "./pageinfo.js"; export type PaginatedResponseCommentResults = { data: Array; /** * Provides information about the pagination of a dataset. */ pageInfo: PageInfo; }; export type PaginatedResponseComment = { results: PaginatedResponseCommentResults; }; /** @internal */ export const PaginatedResponseCommentResults$inboundSchema: z.ZodType< PaginatedResponseCommentResults, z.ZodTypeDef, unknown > = z.object({ data: z.array(Comment$inboundSchema), pageInfo: PageInfo$inboundSchema, }); export function paginatedResponseCommentResultsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaginatedResponseCommentResults$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaginatedResponseCommentResults' from JSON`, ); } /** @internal */ export const PaginatedResponseComment$inboundSchema: z.ZodType< PaginatedResponseComment, z.ZodTypeDef, unknown > = z.object({ results: z.lazy(() => PaginatedResponseCommentResults$inboundSchema), }); export function paginatedResponseCommentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaginatedResponseComment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaginatedResponseComment' from JSON`, ); }