"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.ActionReviewRequestedStreamingEvent$inboundSchema = exports.ActionReviewRequestedStreamingEventData$inboundSchema = exports.Tool$inboundSchema = exports.Conditions$inboundSchema = void 0;
exports.conditionsFromJSON = conditionsFromJSON;
exports.toolFromJSON = toolFromJSON;
exports.actionReviewRequestedStreamingEventDataFromJSON = actionReviewRequestedStreamingEventDataFromJSON;
exports.actionReviewRequestedStreamingEventFromJSON = actionReviewRequestedStreamingEventFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/** @internal */
exports.Conditions$inboundSchema = z.object({
    condition: z.string(),
    operator: z.string(),
    value: z.string(),
});
function conditionsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Conditions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Conditions' from JSON`);
}
/** @internal */
exports.Tool$inboundSchema = z
    .object({
    id: z.string(),
    key: z.string().optional(),
    action_type: z.string(),
    display_name: z.string().optional(),
    description: z.string().optional(),
    requires_approval: z.boolean().default(false),
    tool_id: z.string().optional(),
    conditions: z.array(z.lazy(() => exports.Conditions$inboundSchema)).optional(),
    timeout: z.number().default(120),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "action_type": "actionType",
        "display_name": "displayName",
        "requires_approval": "requiresApproval",
        "tool_id": "toolId",
    });
});
function toolFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Tool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Tool' from JSON`);
}
/** @internal */
exports.ActionReviewRequestedStreamingEventData$inboundSchema = z.object({
    agent_id: z.string(),
    action_id: z.string(),
    requires_approval: z.boolean(),
    tool: z.lazy(() => exports.Tool$inboundSchema),
    input: z.record(z.any()),
    agent_tool_call_id: z.string(),
    responseId: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "agent_id": "agentId",
        "action_id": "actionId",
        "requires_approval": "requiresApproval",
        "agent_tool_call_id": "agentToolCallId",
    });
});
function actionReviewRequestedStreamingEventDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ActionReviewRequestedStreamingEventData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActionReviewRequestedStreamingEventData' from JSON`);
}
/** @internal */
exports.ActionReviewRequestedStreamingEvent$inboundSchema = z.object({
    type: z.literal("event.agents.action_review_requested"),
    timestamp: z.string(),
    data: z.lazy(() => exports.ActionReviewRequestedStreamingEventData$inboundSchema),
});
function actionReviewRequestedStreamingEventFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ActionReviewRequestedStreamingEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActionReviewRequestedStreamingEvent' from JSON`);
}
//# sourceMappingURL=actionreviewrequestedstreamingevent.js.map