/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; /** * Provider connection test result */ export type TestConnectionResult = { /** * Whether the connection test succeeded */ success: boolean; /** * Provider type tested */ provider: string; /** * Result message */ message: string; /** * Response latency in milliseconds */ latencyMs?: number | undefined; /** * Available models (if provider supports listing) */ models?: Array | undefined; }; /** @internal */ export const TestConnectionResult$inboundSchema: z.ZodMiniType< TestConnectionResult, unknown > = z.object({ success: types.boolean(), provider: types.string(), message: types.string(), latencyMs: types.optional(types.number()), models: types.optional(z.array(types.string())), }); export function testConnectionResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TestConnectionResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestConnectionResult' from JSON`, ); }