/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListApiKeyPairsRequest = { /** * A pointer to the page of results to return. */ cursor?: string | null | undefined; /** * The maximum number of items that are returned. */ limit?: number | undefined; }; export type ListApiKeyPairsResponse = { result: components.CollectionAPIKeyPair; }; /** @internal */ export type ListApiKeyPairsRequest$Outbound = { cursor?: string | null | undefined; limit: number; }; /** @internal */ export const ListApiKeyPairsRequest$outboundSchema: z.ZodType< ListApiKeyPairsRequest$Outbound, z.ZodTypeDef, ListApiKeyPairsRequest > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), }); export function listApiKeyPairsRequestToJSON( listApiKeyPairsRequest: ListApiKeyPairsRequest, ): string { return JSON.stringify( ListApiKeyPairsRequest$outboundSchema.parse(listApiKeyPairsRequest), ); } /** @internal */ export const ListApiKeyPairsResponse$inboundSchema: z.ZodType< ListApiKeyPairsResponse, z.ZodTypeDef, unknown > = z.object({ Result: components.CollectionAPIKeyPair$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); export function listApiKeyPairsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListApiKeyPairsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListApiKeyPairsResponse' from JSON`, ); }