"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAiTextGenAgent = serializeAiTextGenAgent;
exports.deserializeAiTextGenAgent = deserializeAiTextGenAgent;
const aiAgentReference_1 = require("./aiAgentReference");
const aiAgentReference_2 = require("./aiAgentReference");
const aiAgentTextGen_1 = require("./aiAgentTextGen");
const aiAgentTextGen_2 = require("./aiAgentTextGen");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
function serializeAiTextGenAgent(val) {
    if (val.type == 'ai_agent_id') {
        return (0, aiAgentReference_1.serializeAiAgentReference)(val);
    }
    if (val.type == 'ai_agent_text_gen') {
        return (0, aiAgentTextGen_1.serializeAiAgentTextGen)(val);
    }
    throw new errors_1.BoxSdkError({ message: 'unknown type' });
}
function deserializeAiTextGenAgent(val) {
    if (!(0, json_1.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({ message: 'Expecting a map for "AiTextGenAgent"' });
    }
    if (val.type == 'ai_agent_id') {
        return (0, aiAgentReference_2.deserializeAiAgentReference)(val);
    }
    if (val.type == 'ai_agent_text_gen') {
        return (0, aiAgentTextGen_2.deserializeAiAgentTextGen)(val);
    }
    throw new errors_1.BoxSdkError({ message: "Can't deserialize AiTextGenAgent" });
}
//# sourceMappingURL=aiTextGenAgent.js.map