"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeMetadataTaxonomyLevel = serializeMetadataTaxonomyLevel;
exports.deserializeMetadataTaxonomyLevel = deserializeMetadataTaxonomyLevel;
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
const json_2 = require("../serialization/json");
const json_3 = require("../serialization/json");
function serializeMetadataTaxonomyLevel(val) {
    return {
        ['displayName']: val.displayName,
        ['description']: val.description,
        ['level']: val.level,
    };
}
function deserializeMetadataTaxonomyLevel(val) {
    if (!(0, json_3.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "MetadataTaxonomyLevel"',
        });
    }
    if (!(val.displayName == void 0) && !(0, json_2.sdIsString)(val.displayName)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "displayName" of type "MetadataTaxonomyLevel"',
        });
    }
    const displayName = val.displayName == void 0 ? void 0 : val.displayName;
    if (!(val.description == void 0) && !(0, json_2.sdIsString)(val.description)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "description" of type "MetadataTaxonomyLevel"',
        });
    }
    const description = val.description == void 0 ? void 0 : val.description;
    if (!(val.level == void 0) && !(0, json_1.sdIsNumber)(val.level)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting number for "level" of type "MetadataTaxonomyLevel"',
        });
    }
    const level = val.level == void 0 ? void 0 : val.level;
    return {
        displayName: displayName,
        description: description,
        level: level,
    };
}
//# sourceMappingURL=metadataTaxonomyLevel.js.map