"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeAiExtractStructuredAgent = serializeAiExtractStructuredAgent;
exports.deserializeAiExtractStructuredAgent = deserializeAiExtractStructuredAgent;
const aiAgentReference_1 = require("./aiAgentReference");
const aiAgentReference_2 = require("./aiAgentReference");
const aiAgentExtractStructured_1 = require("./aiAgentExtractStructured");
const aiAgentExtractStructured_2 = require("./aiAgentExtractStructured");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
function serializeAiExtractStructuredAgent(val) {
    if (val.type == 'ai_agent_id') {
        return (0, aiAgentReference_1.serializeAiAgentReference)(val);
    }
    if (val.type == 'ai_agent_extract_structured') {
        return (0, aiAgentExtractStructured_1.serializeAiAgentExtractStructured)(val);
    }
    throw new errors_1.BoxSdkError({ message: 'unknown type' });
}
function deserializeAiExtractStructuredAgent(val) {
    if (!(0, json_1.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "AiExtractStructuredAgent"',
        });
    }
    if (val.type == 'ai_agent_id') {
        return (0, aiAgentReference_2.deserializeAiAgentReference)(val);
    }
    if (val.type == 'ai_agent_extract_structured') {
        return (0, aiAgentExtractStructured_2.deserializeAiAgentExtractStructured)(val);
    }
    throw new errors_1.BoxSdkError({
        message: "Can't deserialize AiExtractStructuredAgent",
    });
}
//# sourceMappingURL=aiExtractStructuredAgent.js.map