UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

49 lines (44 loc) 1.28 kB
/* * 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 * as types from "../types/primitives.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; /** * This object contains information related to the pagination of the current request, including the necessary parameters to get the next or previous page of data. */ export type Pagination = { /** * Amount of items in the current page. */ count: number; /** * Timestamp that must be used to request the next page. */ next: number | null; /** * Timestamp that must be used to request the previous page. */ prev: number | null; }; /** @internal */ export const Pagination$inboundSchema: z.ZodType< Pagination, z.ZodTypeDef, unknown > = z.object({ count: types.number(), next: types.nullable(types.number()), prev: types.nullable(types.number()), }); export function paginationFromJSON( jsonString: string, ): SafeParseResult<Pagination, SDKValidationError> { return safeParse( jsonString, (x) => Pagination$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Pagination' from JSON`, ); }