"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeEnterpriseConfigurationShieldV2025R0 = serializeEnterpriseConfigurationShieldV2025R0;
exports.deserializeEnterpriseConfigurationShieldV2025R0 = deserializeEnterpriseConfigurationShieldV2025R0;
const shieldRuleItemV2025R0_1 = require("./shieldRuleItemV2025R0");
const shieldRuleItemV2025R0_2 = require("./shieldRuleItemV2025R0");
const errors_1 = require("../../box/errors");
const json_1 = require("../../serialization/json");
const json_2 = require("../../serialization/json");
function serializeEnterpriseConfigurationShieldV2025R0(val) {
    return {
        ['shield_rules']: val.shieldRules == void 0
            ? val.shieldRules
            : val.shieldRules.map(function (item) {
                return (0, shieldRuleItemV2025R0_1.serializeShieldRuleItemV2025R0)(item);
            }),
    };
}
function deserializeEnterpriseConfigurationShieldV2025R0(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "EnterpriseConfigurationShieldV2025R0"',
        });
    }
    if (!(val.shield_rules == void 0) && !(0, json_1.sdIsList)(val.shield_rules)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting array for "shield_rules" of type "EnterpriseConfigurationShieldV2025R0"',
        });
    }
    const shieldRules = val.shield_rules == void 0
        ? void 0
        : (0, json_1.sdIsList)(val.shield_rules)
            ? val.shield_rules.map(function (itm) {
                return (0, shieldRuleItemV2025R0_2.deserializeShieldRuleItemV2025R0)(itm);
            })
            : [];
    return {
        shieldRules: shieldRules,
    };
}
//# sourceMappingURL=enterpriseConfigurationShieldV2025R0.js.map