box-node-sdk
Version:
Official SDK for Box Platform APIs
38 lines • 1.63 kB
JavaScript
import { serializeEnterpriseConfigurationItemV2025R0 } from './enterpriseConfigurationItemV2025R0.js';
import { BoxSdkError } from '../../box/errors.js';
import { sdIsBoolean } from '../../serialization/json.js';
import { sdIsNumber } from '../../serialization/json.js';
import { sdIsMap } from '../../serialization/json.js';
export function serializeEnterpriseConfigurationItemIntegerV2025R0(val) {
const base = serializeEnterpriseConfigurationItemV2025R0(val);
if (!sdIsMap(base)) {
throw new BoxSdkError({
message: 'Expecting a map for "EnterpriseConfigurationItemIntegerV2025R0"',
});
}
return { ...base, ...{ ['value']: val.value } };
}
export function deserializeEnterpriseConfigurationItemIntegerV2025R0(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({
message: 'Expecting a map for "EnterpriseConfigurationItemIntegerV2025R0"',
});
}
if (!(val.value == void 0) && !sdIsNumber(val.value)) {
throw new BoxSdkError({
message: 'Expecting number for "value" of type "EnterpriseConfigurationItemIntegerV2025R0"',
});
}
const value = val.value == void 0 ? void 0 : val.value;
if (!(val.is_used == void 0) && !sdIsBoolean(val.is_used)) {
throw new BoxSdkError({
message: 'Expecting boolean for "is_used" of type "EnterpriseConfigurationItemIntegerV2025R0"',
});
}
const isUsed = val.is_used == void 0 ? void 0 : val.is_used;
return {
value: value,
isUsed: isUsed,
};
}
//# sourceMappingURL=enterpriseConfigurationItemIntegerV2025R0.js.map