/* * 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 { MCPAllowedTools, MCPAllowedTools$inboundSchema, MCPAllowedTools$Outbound, MCPAllowedTools$outboundSchema, } from "./mcpallowedtools.js"; import { MCPRequireApproval, MCPRequireApproval$inboundSchema, MCPRequireApproval$outboundSchema, } from "./mcprequireapproval.js"; export type UpdateMcpServerRequest = { name?: string | undefined; serverLabel?: string | undefined; serverUrl?: string | undefined; serverDescription?: string | null | undefined; allowedTools?: MCPAllowedTools | null | undefined; requireApproval?: MCPRequireApproval | undefined; metadata?: { [k: string]: any } | undefined; }; /** @internal */ export const UpdateMcpServerRequest$inboundSchema: z.ZodType< UpdateMcpServerRequest, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), server_label: z.string().optional(), server_url: z.string().optional(), server_description: z.nullable(z.string()).optional(), allowed_tools: z.nullable(MCPAllowedTools$inboundSchema).optional(), require_approval: MCPRequireApproval$inboundSchema.optional(), metadata: z.record(z.any()).optional(), }).transform((v) => { return remap$(v, { "server_label": "serverLabel", "server_url": "serverUrl", "server_description": "serverDescription", "allowed_tools": "allowedTools", "require_approval": "requireApproval", }); }); /** @internal */ export type UpdateMcpServerRequest$Outbound = { name?: string | undefined; server_label?: string | undefined; server_url?: string | undefined; server_description?: string | null | undefined; allowed_tools?: MCPAllowedTools$Outbound | null | undefined; require_approval?: string | undefined; metadata?: { [k: string]: any } | undefined; }; /** @internal */ export const UpdateMcpServerRequest$outboundSchema: z.ZodType< UpdateMcpServerRequest$Outbound, z.ZodTypeDef, UpdateMcpServerRequest > = z.object({ name: z.string().optional(), serverLabel: z.string().optional(), serverUrl: z.string().optional(), serverDescription: z.nullable(z.string()).optional(), allowedTools: z.nullable(MCPAllowedTools$outboundSchema).optional(), requireApproval: MCPRequireApproval$outboundSchema.optional(), metadata: z.record(z.any()).optional(), }).transform((v) => { return remap$(v, { serverLabel: "server_label", serverUrl: "server_url", serverDescription: "server_description", allowedTools: "allowed_tools", requireApproval: "require_approval", }); }); export function updateMcpServerRequestToJSON( updateMcpServerRequest: UpdateMcpServerRequest, ): string { return JSON.stringify( UpdateMcpServerRequest$outboundSchema.parse(updateMcpServerRequest), ); } export function updateMcpServerRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateMcpServerRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMcpServerRequest' from JSON`, ); }