/* * 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"; /** * MCP approval request item: A request to approve or deny execution of an MCP tool call. */ export type MCPApprovalRequest = { type: "mcp_approval_request"; id: string; arguments: string; name: string; serverLabel: string; }; /** @internal */ export const MCPApprovalRequest$inboundSchema: z.ZodType< MCPApprovalRequest, z.ZodTypeDef, unknown > = z.object({ type: z.literal("mcp_approval_request"), id: z.string(), arguments: z.string(), name: z.string(), server_label: z.string(), }).transform((v) => { return remap$(v, { "server_label": "serverLabel", }); }); /** @internal */ export type MCPApprovalRequest$Outbound = { type: "mcp_approval_request"; id: string; arguments: string; name: string; server_label: string; }; /** @internal */ export const MCPApprovalRequest$outboundSchema: z.ZodType< MCPApprovalRequest$Outbound, z.ZodTypeDef, MCPApprovalRequest > = z.object({ type: z.literal("mcp_approval_request"), id: z.string(), arguments: z.string(), name: z.string(), serverLabel: z.string(), }).transform((v) => { return remap$(v, { serverLabel: "server_label", }); }); export function mcpApprovalRequestToJSON( mcpApprovalRequest: MCPApprovalRequest, ): string { return JSON.stringify( MCPApprovalRequest$outboundSchema.parse(mcpApprovalRequest), ); } export function mcpApprovalRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MCPApprovalRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MCPApprovalRequest' from JSON`, ); }