/* * 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"; /** * Custom tool call item: A call record for a custom tool with input payload and tool name. */ export type CustomToolCall = { type: "custom_tool_call"; callId: string; input: string; name: string; id?: string | undefined; }; /** @internal */ export const CustomToolCall$inboundSchema: z.ZodType< CustomToolCall, z.ZodTypeDef, unknown > = z.object({ type: z.literal("custom_tool_call"), call_id: z.string(), input: z.string(), name: z.string(), id: z.string().optional(), }).transform((v) => { return remap$(v, { "call_id": "callId", }); }); /** @internal */ export type CustomToolCall$Outbound = { type: "custom_tool_call"; call_id: string; input: string; name: string; id?: string | undefined; }; /** @internal */ export const CustomToolCall$outboundSchema: z.ZodType< CustomToolCall$Outbound, z.ZodTypeDef, CustomToolCall > = z.object({ type: z.literal("custom_tool_call"), callId: z.string(), input: z.string(), name: z.string(), id: z.string().optional(), }).transform((v) => { return remap$(v, { callId: "call_id", }); }); export function customToolCallToJSON(customToolCall: CustomToolCall): string { return JSON.stringify(CustomToolCall$outboundSchema.parse(customToolCall)); } export function customToolCallFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomToolCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomToolCall' from JSON`, ); }