"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeMetadataTaxonomyLevels = serializeMetadataTaxonomyLevels;
exports.deserializeMetadataTaxonomyLevels = deserializeMetadataTaxonomyLevels;
const metadataTaxonomyLevel_1 = require("./metadataTaxonomyLevel");
const metadataTaxonomyLevel_2 = require("./metadataTaxonomyLevel");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
const json_2 = require("../serialization/json");
function serializeMetadataTaxonomyLevels(val) {
    return {
        ['entries']: val.entries == void 0
            ? val.entries
            : val.entries.map(function (item) {
                return (0, metadataTaxonomyLevel_1.serializeMetadataTaxonomyLevel)(item);
            }),
    };
}
function deserializeMetadataTaxonomyLevels(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "MetadataTaxonomyLevels"',
        });
    }
    if (!(val.entries == void 0) && !(0, json_1.sdIsList)(val.entries)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting array for "entries" of type "MetadataTaxonomyLevels"',
        });
    }
    const entries = val.entries == void 0
        ? void 0
        : (0, json_1.sdIsList)(val.entries)
            ? val.entries.map(function (itm) {
                return (0, metadataTaxonomyLevel_2.deserializeMetadataTaxonomyLevel)(itm);
            })
            : [];
    return { entries: entries };
}
//# sourceMappingURL=metadataTaxonomyLevels.js.map