/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { APIKeyPair, APIKeyPair$inboundSchema } from "./apikeypair.js"; export type CollectionAPIKeyPair = { /** * A list of items returned for this request. */ items: Array; /** * The number of items for this page. */ limit: number; /** * The cursor pointing at the next page of items. */ nextCursor?: string | null | undefined; /** * The cursor pointing at the previous page of items. */ previousCursor?: string | null | undefined; }; /** @internal */ export const CollectionAPIKeyPair$inboundSchema: z.ZodType< CollectionAPIKeyPair, z.ZodTypeDef, unknown > = z.object({ items: z.array(APIKeyPair$inboundSchema), limit: z.number().int().default(20), next_cursor: z.nullable(z.string()).optional(), previous_cursor: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "next_cursor": "nextCursor", "previous_cursor": "previousCursor", }); }); export function collectionAPIKeyPairFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectionAPIKeyPair$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectionAPIKeyPair' from JSON`, ); }