/* * 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 { McpServer, McpServer$inboundSchema, McpServer$Outbound, McpServer$outboundSchema, } from "./mcpserver.js"; export type McpServerList = { object: "list"; data: Array; firstId: string | null; hasMore: boolean; lastId: string | null; }; /** @internal */ export const McpServerList$inboundSchema: z.ZodType< McpServerList, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list"), data: z.array(McpServer$inboundSchema), first_id: z.nullable(z.string()), has_more: z.boolean(), last_id: z.nullable(z.string()), }).transform((v) => { return remap$(v, { "first_id": "firstId", "has_more": "hasMore", "last_id": "lastId", }); }); /** @internal */ export type McpServerList$Outbound = { object: "list"; data: Array; first_id: string | null; has_more: boolean; last_id: string | null; }; /** @internal */ export const McpServerList$outboundSchema: z.ZodType< McpServerList$Outbound, z.ZodTypeDef, McpServerList > = z.object({ object: z.literal("list"), data: z.array(McpServer$outboundSchema), firstId: z.nullable(z.string()), hasMore: z.boolean(), lastId: z.nullable(z.string()), }).transform((v) => { return remap$(v, { firstId: "first_id", hasMore: "has_more", lastId: "last_id", }); }); export function mcpServerListToJSON(mcpServerList: McpServerList): string { return JSON.stringify(McpServerList$outboundSchema.parse(mcpServerList)); } export function mcpServerListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => McpServerList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServerList' from JSON`, ); }