"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeLegalHoldPolicyAssignedItem = serializeLegalHoldPolicyAssignedItem;
exports.deserializeLegalHoldPolicyAssignedItem = deserializeLegalHoldPolicyAssignedItem;
const file_1 = require("./file");
const file_2 = require("./file");
const folder_1 = require("./folder");
const folder_2 = require("./folder");
const webLink_1 = require("./webLink");
const webLink_2 = require("./webLink");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
function serializeLegalHoldPolicyAssignedItem(val) {
    if (val.type == 'file') {
        return (0, file_1.serializeFile)(val);
    }
    if (val.type == 'folder') {
        return (0, folder_1.serializeFolder)(val);
    }
    if (val.type == 'web_link') {
        return (0, webLink_1.serializeWebLink)(val);
    }
    throw new errors_1.BoxSdkError({ message: 'unknown type' });
}
function deserializeLegalHoldPolicyAssignedItem(val) {
    if (!(0, json_1.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "LegalHoldPolicyAssignedItem"',
        });
    }
    if (val.type == 'file') {
        return (0, file_2.deserializeFile)(val);
    }
    if (val.type == 'folder') {
        return (0, folder_2.deserializeFolder)(val);
    }
    if (val.type == 'web_link') {
        return (0, webLink_2.deserializeWebLink)(val);
    }
    throw new errors_1.BoxSdkError({
        message: "Can't deserialize LegalHoldPolicyAssignedItem",
    });
}
//# sourceMappingURL=legalHoldPolicyAssignedItem.js.map