/* * 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 { McpCredential, McpCredential$inboundSchema, McpCredential$Outbound, McpCredential$outboundSchema, } from "./mcpcredential.js"; export type McpCredentialList = { object: "list"; data: Array; firstId: string | null; hasMore: boolean; lastId: string | null; }; /** @internal */ export const McpCredentialList$inboundSchema: z.ZodType< McpCredentialList, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list"), data: z.array(McpCredential$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 McpCredentialList$Outbound = { object: "list"; data: Array; first_id: string | null; has_more: boolean; last_id: string | null; }; /** @internal */ export const McpCredentialList$outboundSchema: z.ZodType< McpCredentialList$Outbound, z.ZodTypeDef, McpCredentialList > = z.object({ object: z.literal("list"), data: z.array(McpCredential$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 mcpCredentialListToJSON( mcpCredentialList: McpCredentialList, ): string { return JSON.stringify( McpCredentialList$outboundSchema.parse(mcpCredentialList), ); } export function mcpCredentialListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => McpCredentialList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpCredentialList' from JSON`, ); }