"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAiAskAgent = serializeAiAskAgent;
exports.deserializeAiAskAgent = deserializeAiAskAgent;
const aiAgentReference_1 = require("./aiAgentReference");
const aiAgentReference_2 = require("./aiAgentReference");
const aiAgentAsk_1 = require("./aiAgentAsk");
const aiAgentAsk_2 = require("./aiAgentAsk");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
function serializeAiAskAgent(val) {
    if (val.type == 'ai_agent_id') {
        return (0, aiAgentReference_1.serializeAiAgentReference)(val);
    }
    if (val.type == 'ai_agent_ask') {
        return (0, aiAgentAsk_1.serializeAiAgentAsk)(val);
    }
    throw new errors_1.BoxSdkError({ message: 'unknown type' });
}
function deserializeAiAskAgent(val) {
    if (!(0, json_1.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({ message: 'Expecting a map for "AiAskAgent"' });
    }
    if (val.type == 'ai_agent_id') {
        return (0, aiAgentReference_2.deserializeAiAgentReference)(val);
    }
    if (val.type == 'ai_agent_ask') {
        return (0, aiAgentAsk_2.deserializeAiAgentAsk)(val);
    }
    throw new errors_1.BoxSdkError({ message: "Can't deserialize AiAskAgent" });
}
//# sourceMappingURL=aiAskAgent.js.map