/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: e8bed813edfc */ import * as z from "zod/v4"; 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 { ConnectionConfigType, ConnectionConfigType$inboundSchema, } from "./connectionconfigtype.js"; import { ToolExecutionConfiguration, ToolExecutionConfiguration$inboundSchema, } from "./toolexecutionconfiguration.js"; /** * Connection config exposed in the public, unauthenticated /connectors/mistral response. * * @remarks * * Unlike ConnectionConfig, this has no `headers` field and forbids extra fields, so * connector credentials can never be serialized into this cacheable response. */ export type PublicExecutionConnectionConfig = { type: ConnectionConfigType; server?: string | null | undefined; name?: string | null | undefined; id?: string | null | undefined; toolConfiguration?: ToolExecutionConfiguration | null | undefined; hostedInternally: boolean; }; /** @internal */ export const PublicExecutionConnectionConfig$inboundSchema: z.ZodType< PublicExecutionConnectionConfig, unknown > = z.object({ type: ConnectionConfigType$inboundSchema, server: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), tool_configuration: z.nullable(ToolExecutionConfiguration$inboundSchema) .optional(), hosted_internally: z.boolean().default(false), }).transform((v) => { return remap$(v, { "tool_configuration": "toolConfiguration", "hosted_internally": "hostedInternally", }); }); export function publicExecutionConnectionConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PublicExecutionConnectionConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicExecutionConnectionConfig' from JSON`, ); }