"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeShieldInformationBarrierSegmentMemberMini = serializeShieldInformationBarrierSegmentMemberMini;
exports.deserializeShieldInformationBarrierSegmentMemberMini = deserializeShieldInformationBarrierSegmentMemberMini;
const shieldInformationBarrierSegmentMemberBase_1 = require("./shieldInformationBarrierSegmentMemberBase");
const shieldInformationBarrierSegmentMemberBase_2 = require("./shieldInformationBarrierSegmentMemberBase");
const userBase_1 = require("./userBase");
const userBase_2 = require("./userBase");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
const json_2 = require("../serialization/json");
function serializeShieldInformationBarrierSegmentMemberMini(val) {
    const base = (0, shieldInformationBarrierSegmentMemberBase_2.serializeShieldInformationBarrierSegmentMemberBase)(val);
    if (!(0, json_2.sdIsMap)(base)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "ShieldInformationBarrierSegmentMemberMini"',
        });
    }
    return {
        ...base,
        ...{
            ['user']: val.user == void 0 ? val.user : (0, userBase_1.serializeUserBase)(val.user),
        },
    };
}
function deserializeShieldInformationBarrierSegmentMemberMini(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "ShieldInformationBarrierSegmentMemberMini"',
        });
    }
    const user = val.user == void 0 ? void 0 : (0, userBase_2.deserializeUserBase)(val.user);
    if (!(val.id == void 0) && !(0, json_1.sdIsString)(val.id)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "id" of type "ShieldInformationBarrierSegmentMemberMini"',
        });
    }
    const id = val.id == void 0 ? void 0 : val.id;
    const type = val.type == void 0
        ? void 0
        : (0, shieldInformationBarrierSegmentMemberBase_1.deserializeShieldInformationBarrierSegmentMemberBaseTypeField)(val.type);
    return {
        user: user,
        id: id,
        type: type,
    };
}
//# sourceMappingURL=shieldInformationBarrierSegmentMemberMini.js.map