/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 8104b99f27c9 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Parameter type (string, number, boolean, object, array) */ export const ToolParameterType = { String: "string", Number: "number", Boolean: "boolean", Object: "object", Array: "array", } as const; /** * Parameter type (string, number, boolean, object, array) */ export type ToolParameterType = OpenEnum; export type ToolParameter = { /** * Parameter type (string, number, boolean, object, array) */ type?: ToolParameterType | undefined; /** * The name of the parameter */ name?: string | undefined; /** * The description of the parameter */ description?: string | undefined; /** * Whether the parameter is required */ isRequired?: boolean | undefined; /** * The possible values for the parameter. Can contain only primitive values or arrays of primitive values. */ possibleValues?: Array | undefined; items?: ToolParameter | undefined; /** * When type is 'object', this describes the structure of the object. */ properties?: { [k: string]: ToolParameter } | undefined; }; /** @internal */ export const ToolParameterType$inboundSchema: z.ZodType< ToolParameterType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(ToolParameterType); /** @internal */ export const ToolParameter$inboundSchema: z.ZodType< ToolParameter, z.ZodTypeDef, unknown > = z.object({ type: ToolParameterType$inboundSchema.optional(), name: z.string().optional(), description: z.string().optional(), isRequired: z.boolean().optional(), possibleValues: z.array(z.string()).optional(), items: z.lazy(() => ToolParameter$inboundSchema).optional(), properties: z.record(z.lazy(() => ToolParameter$inboundSchema)).optional(), }); export function toolParameterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolParameter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolParameter' from JSON`, ); }