"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAiAgent = serializeAiAgent;
exports.deserializeAiAgent = deserializeAiAgent;
const aiAgentAsk_1 = require("./aiAgentAsk");
const aiAgentAsk_2 = require("./aiAgentAsk");
const aiAgentTextGen_1 = require("./aiAgentTextGen");
const aiAgentTextGen_2 = require("./aiAgentTextGen");
const aiAgentExtract_1 = require("./aiAgentExtract");
const aiAgentExtract_2 = require("./aiAgentExtract");
const aiAgentExtractStructured_1 = require("./aiAgentExtractStructured");
const aiAgentExtractStructured_2 = require("./aiAgentExtractStructured");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
function serializeAiAgent(val) {
    if (val.type == 'ai_agent_ask') {
        return (0, aiAgentAsk_1.serializeAiAgentAsk)(val);
    }
    if (val.type == 'ai_agent_text_gen') {
        return (0, aiAgentTextGen_1.serializeAiAgentTextGen)(val);
    }
    if (val.type == 'ai_agent_extract') {
        return (0, aiAgentExtract_1.serializeAiAgentExtract)(val);
    }
    if (val.type == 'ai_agent_extract_structured') {
        return (0, aiAgentExtractStructured_1.serializeAiAgentExtractStructured)(val);
    }
    throw new errors_1.BoxSdkError({ message: 'unknown type' });
}
function deserializeAiAgent(val) {
    if (!(0, json_1.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({ message: 'Expecting a map for "AiAgent"' });
    }
    if (val.type == 'ai_agent_ask') {
        return (0, aiAgentAsk_2.deserializeAiAgentAsk)(val);
    }
    if (val.type == 'ai_agent_text_gen') {
        return (0, aiAgentTextGen_2.deserializeAiAgentTextGen)(val);
    }
    if (val.type == 'ai_agent_extract') {
        return (0, aiAgentExtract_2.deserializeAiAgentExtract)(val);
    }
    if (val.type == 'ai_agent_extract_structured') {
        return (0, aiAgentExtractStructured_2.deserializeAiAgentExtractStructured)(val);
    }
    throw new errors_1.BoxSdkError({ message: "Can't deserialize AiAgent" });
}
//# sourceMappingURL=aiAgent.js.map