"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolExecutionFailedStreamingEvent$inboundSchema = exports.ToolExecutionFailedStreamingEventData$inboundSchema = exports.ToolExecutionFailedStreamingEventToolExecutionContext$inboundSchema = exports.ToolExecutionFailedStreamingEventMemory$inboundSchema = exports.ToolExecutionFailedStreamingEventProduct$inboundSchema = exports.ErrorT$inboundSchema = exports.ToolExecutionFailedStreamingEventProduct = void 0;
exports.errorFromJSON = errorFromJSON;
exports.toolExecutionFailedStreamingEventMemoryFromJSON = toolExecutionFailedStreamingEventMemoryFromJSON;
exports.toolExecutionFailedStreamingEventToolExecutionContextFromJSON = toolExecutionFailedStreamingEventToolExecutionContextFromJSON;
exports.toolExecutionFailedStreamingEventDataFromJSON = toolExecutionFailedStreamingEventDataFromJSON;
exports.toolExecutionFailedStreamingEventFromJSON = toolExecutionFailedStreamingEventFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * Orquesta product
 */
exports.ToolExecutionFailedStreamingEventProduct = {
    Remoteconfigs: "remoteconfigs",
    Deployments: "deployments",
    Experiments: "experiments",
    Playgrounds: "playgrounds",
    Spreadsheets: "spreadsheets",
    SpreadsheetRun: "spreadsheet_run",
    LlmEvaluator: "llm_evaluator",
    Knowledge: "knowledge",
    Router: "router",
    Workflows: "workflows",
    ExternalEvents: "external_events",
    Agents: "agents",
    MemoryStores: "memory-stores",
    Generic: "generic",
    Evaluators: "evaluators",
    Otel: "otel",
    AiChat: "ai-chat",
};
/** @internal */
exports.ErrorT$inboundSchema = z
    .object({
    message: z.string(),
    stack: z.string().optional(),
});
function errorFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ErrorT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorT' from JSON`);
}
/** @internal */
exports.ToolExecutionFailedStreamingEventProduct$inboundSchema = z
    .nativeEnum(exports.ToolExecutionFailedStreamingEventProduct);
/** @internal */
exports.ToolExecutionFailedStreamingEventMemory$inboundSchema = z.object({
    entity_id: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "entity_id": "entityId",
    });
});
function toolExecutionFailedStreamingEventMemoryFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFailedStreamingEventMemory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFailedStreamingEventMemory' from JSON`);
}
/** @internal */
exports.ToolExecutionFailedStreamingEventToolExecutionContext$inboundSchema = z.object({
    action_id: z.string(),
    agent_tool_call_id: z.string(),
    workspace_id: z.string(),
    agent_manifest_id: z.string(),
    agent_execution_id: z.string(),
    product: exports.ToolExecutionFailedStreamingEventProduct$inboundSchema,
    memory: z.lazy(() => exports.ToolExecutionFailedStreamingEventMemory$inboundSchema)
        .optional(),
    parent_id: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "action_id": "actionId",
        "agent_tool_call_id": "agentToolCallId",
        "workspace_id": "workspaceId",
        "agent_manifest_id": "agentManifestId",
        "agent_execution_id": "agentExecutionId",
        "parent_id": "parentId",
    });
});
function toolExecutionFailedStreamingEventToolExecutionContextFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFailedStreamingEventToolExecutionContext$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFailedStreamingEventToolExecutionContext' from JSON`);
}
/** @internal */
exports.ToolExecutionFailedStreamingEventData$inboundSchema = z.object({
    error: z.lazy(() => exports.ErrorT$inboundSchema),
    action_type: z.string(),
    tool_execution_context: z.lazy(() => exports.ToolExecutionFailedStreamingEventToolExecutionContext$inboundSchema),
    responseId: z.string().optional(),
    workflowRunId: z.string(),
    stream: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "action_type": "actionType",
        "tool_execution_context": "toolExecutionContext",
    });
});
function toolExecutionFailedStreamingEventDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFailedStreamingEventData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFailedStreamingEventData' from JSON`);
}
/** @internal */
exports.ToolExecutionFailedStreamingEvent$inboundSchema = z.object({
    type: z.literal("event.workflow_events.tool_execution_failed"),
    timestamp: z.string(),
    data: z.lazy(() => exports.ToolExecutionFailedStreamingEventData$inboundSchema),
});
function toolExecutionFailedStreamingEventFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ToolExecutionFailedStreamingEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolExecutionFailedStreamingEvent' from JSON`);
}
//# sourceMappingURL=toolexecutionfailedstreamingevent.js.map