box-node-sdk
Version:
Official SDK for Box Platform APIs
41 lines • 1.99 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeEnterpriseConfigurationItemBooleanV2025R0 = serializeEnterpriseConfigurationItemBooleanV2025R0;
exports.deserializeEnterpriseConfigurationItemBooleanV2025R0 = deserializeEnterpriseConfigurationItemBooleanV2025R0;
const enterpriseConfigurationItemV2025R0_1 = require("./enterpriseConfigurationItemV2025R0");
const errors_1 = require("../../box/errors");
const json_1 = require("../../serialization/json");
const json_2 = require("../../serialization/json");
function serializeEnterpriseConfigurationItemBooleanV2025R0(val) {
const base = (0, enterpriseConfigurationItemV2025R0_1.serializeEnterpriseConfigurationItemV2025R0)(val);
if (!(0, json_2.sdIsMap)(base)) {
throw new errors_1.BoxSdkError({
message: 'Expecting a map for "EnterpriseConfigurationItemBooleanV2025R0"',
});
}
return Object.assign(Object.assign({}, base), { ['value']: val.value });
}
function deserializeEnterpriseConfigurationItemBooleanV2025R0(val) {
if (!(0, json_2.sdIsMap)(val)) {
throw new errors_1.BoxSdkError({
message: 'Expecting a map for "EnterpriseConfigurationItemBooleanV2025R0"',
});
}
if (!(val.value == void 0) && !(0, json_1.sdIsBoolean)(val.value)) {
throw new errors_1.BoxSdkError({
message: 'Expecting boolean for "value" of type "EnterpriseConfigurationItemBooleanV2025R0"',
});
}
const value = val.value == void 0 ? void 0 : val.value;
if (!(val.is_used == void 0) && !(0, json_1.sdIsBoolean)(val.is_used)) {
throw new errors_1.BoxSdkError({
message: 'Expecting boolean for "is_used" of type "EnterpriseConfigurationItemBooleanV2025R0"',
});
}
const isUsed = val.is_used == void 0 ? void 0 : val.is_used;
return {
value: value,
isUsed: isUsed,
};
}
//# sourceMappingURL=enterpriseConfigurationItemBooleanV2025R0.js.map