/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 6b861b147872
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
import { BuiltInConnectors$inboundSchema, BuiltInConnectors$outboundSchema, } from "./builtinconnectors.js";
/** @internal */
export const ToolFileChunkTool$inboundSchema = smartUnion([BuiltInConnectors$inboundSchema, z.string()]);
/** @internal */
export const ToolFileChunkTool$outboundSchema = smartUnion([BuiltInConnectors$outboundSchema, z.string()]);
export function toolFileChunkToolToJSON(toolFileChunkTool) {
    return JSON.stringify(ToolFileChunkTool$outboundSchema.parse(toolFileChunkTool));
}
export function toolFileChunkToolFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolFileChunkTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolFileChunkTool' from JSON`);
}
/** @internal */
export const ToolFileChunk$inboundSchema = z
    .object({
    type: z.literal("tool_file").default("tool_file"),
    tool: smartUnion([BuiltInConnectors$inboundSchema, z.string()]),
    file_id: z.string(),
    file_name: z.nullable(z.string()).optional(),
    file_type: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        "file_id": "fileId",
        "file_name": "fileName",
        "file_type": "fileType",
    });
});
/** @internal */
export const ToolFileChunk$outboundSchema = z.object({
    type: z.literal("tool_file").default("tool_file"),
    tool: smartUnion([BuiltInConnectors$outboundSchema, z.string()]),
    fileId: z.string(),
    fileName: z.nullable(z.string()).optional(),
    fileType: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        fileId: "file_id",
        fileName: "file_name",
        fileType: "file_type",
    });
});
export function toolFileChunkToJSON(toolFileChunk) {
    return JSON.stringify(ToolFileChunk$outboundSchema.parse(toolFileChunk));
}
export function toolFileChunkFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolFileChunk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolFileChunk' from JSON`);
}
//# sourceMappingURL=toolfilechunk.js.map