UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

43 lines 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeMetadataError = serializeMetadataError; exports.deserializeMetadataError = deserializeMetadataError; const errors_1 = require("../box/errors"); const json_1 = require("../serialization/json"); const json_2 = require("../serialization/json"); function serializeMetadataError(val) { return { ['code']: val.code, ['message']: val.message, ['request_id']: val.requestId, }; } function deserializeMetadataError(val) { if (!(0, json_2.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "MetadataError"' }); } if (!(val.code == void 0) && !(0, json_1.sdIsString)(val.code)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "code" of type "MetadataError"', }); } const code = val.code == void 0 ? void 0 : val.code; if (!(val.message == void 0) && !(0, json_1.sdIsString)(val.message)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "message" of type "MetadataError"', }); } const message = val.message == void 0 ? void 0 : val.message; if (!(val.request_id == void 0) && !(0, json_1.sdIsString)(val.request_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "request_id" of type "MetadataError"', }); } const requestId = val.request_id == void 0 ? void 0 : val.request_id; return { code: code, message: message, requestId: requestId, }; } //# sourceMappingURL=metadataError.js.map