/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const ListMcpServersQueryParamOrder = { Asc: "asc", Desc: "desc", } as const; export type ListMcpServersQueryParamOrder = ClosedEnum< typeof ListMcpServersQueryParamOrder >; export type ListMcpServersRequest = { limit?: number | undefined; after?: string | undefined; order?: ListMcpServersQueryParamOrder | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const ListMcpServersQueryParamOrder$inboundSchema: z.ZodNativeEnum< typeof ListMcpServersQueryParamOrder > = z.nativeEnum(ListMcpServersQueryParamOrder); /** @internal */ export const ListMcpServersQueryParamOrder$outboundSchema: z.ZodNativeEnum< typeof ListMcpServersQueryParamOrder > = ListMcpServersQueryParamOrder$inboundSchema; /** @internal */ export const ListMcpServersRequest$inboundSchema: z.ZodType< ListMcpServersRequest, z.ZodTypeDef, unknown > = z.object({ limit: z.number().int().default(20), after: z.string().optional(), order: ListMcpServersQueryParamOrder$inboundSchema.default("desc"), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type ListMcpServersRequest$Outbound = { limit: number; after?: string | undefined; order: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const ListMcpServersRequest$outboundSchema: z.ZodType< ListMcpServersRequest$Outbound, z.ZodTypeDef, ListMcpServersRequest > = z.object({ limit: z.number().int().default(20), after: z.string().optional(), order: ListMcpServersQueryParamOrder$outboundSchema.default("desc"), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function listMcpServersRequestToJSON( listMcpServersRequest: ListMcpServersRequest, ): string { return JSON.stringify( ListMcpServersRequest$outboundSchema.parse(listMcpServersRequest), ); } export function listMcpServersRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListMcpServersRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListMcpServersRequest' from JSON`, ); }