/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: afc65d62df41
 */
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 ToolExecutionEntryName$inboundSchema = smartUnion([BuiltInConnectors$inboundSchema, z.string()]);
/** @internal */
export const ToolExecutionEntryName$outboundSchema = smartUnion([BuiltInConnectors$outboundSchema, z.string()]);
export function toolExecutionEntryNameToJSON(toolExecutionEntryName) {
    return JSON.stringify(ToolExecutionEntryName$outboundSchema.parse(toolExecutionEntryName));
}
export function toolExecutionEntryNameFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolExecutionEntryName$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionEntryName' from JSON`);
}
/** @internal */
export const ToolExecutionEntry$inboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("tool.execution").default("tool.execution"),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    completed_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
    agent_id: z.nullable(z.string()).optional(),
    model: z.nullable(z.string()).optional(),
    id: z.string().optional(),
    name: smartUnion([BuiltInConnectors$inboundSchema, z.string()]),
    arguments: z.string(),
    info: z.record(z.string(), z.any()).optional(),
}).transform((v) => {
    return remap$(v, {
        "created_at": "createdAt",
        "completed_at": "completedAt",
        "agent_id": "agentId",
    });
});
/** @internal */
export const ToolExecutionEntry$outboundSchema = z.object({
    object: z.literal("entry").default("entry"),
    type: z.literal("tool.execution").default("tool.execution"),
    createdAt: z.date().transform(v => v.toISOString()).optional(),
    completedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    agentId: z.nullable(z.string()).optional(),
    model: z.nullable(z.string()).optional(),
    id: z.string().optional(),
    name: smartUnion([BuiltInConnectors$outboundSchema, z.string()]),
    arguments: z.string(),
    info: z.record(z.string(), z.any()).optional(),
}).transform((v) => {
    return remap$(v, {
        createdAt: "created_at",
        completedAt: "completed_at",
        agentId: "agent_id",
    });
});
export function toolExecutionEntryToJSON(toolExecutionEntry) {
    return JSON.stringify(ToolExecutionEntry$outboundSchema.parse(toolExecutionEntry));
}
export function toolExecutionEntryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolExecutionEntry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionEntry' from JSON`);
}
//# sourceMappingURL=toolexecutionentry.js.map