UNPKG

box-typescript-sdk-gen

Version:
59 lines 2.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeIntegrationMappings = serializeIntegrationMappings; exports.deserializeIntegrationMappings = deserializeIntegrationMappings; const integrationMapping_generated_js_1 = require("./integrationMapping.generated.js"); const integrationMapping_generated_js_2 = require("./integrationMapping.generated.js"); const errors_js_1 = require("../box/errors.js"); const json_js_1 = require("../serialization/json.js"); const json_js_2 = require("../serialization/json.js"); const json_js_3 = require("../serialization/json.js"); const json_js_4 = require("../serialization/json.js"); function serializeIntegrationMappings(val) { return { ['limit']: val.limit, ['next_marker']: val.nextMarker, ['entries']: val.entries == void 0 ? val.entries : val.entries.map(function (item) { return (0, integrationMapping_generated_js_1.serializeIntegrationMapping)(item); }), }; } function deserializeIntegrationMappings(val) { if (!(0, json_js_4.sdIsMap)(val)) { throw new errors_js_1.BoxSdkError({ message: 'Expecting a map for "IntegrationMappings"', }); } if (!(val.limit == void 0) && !(0, json_js_1.sdIsNumber)(val.limit)) { throw new errors_js_1.BoxSdkError({ message: 'Expecting number for "limit" of type "IntegrationMappings"', }); } const limit = val.limit == void 0 ? void 0 : val.limit; if (!(val.next_marker == void 0) && !(0, json_js_2.sdIsString)(val.next_marker)) { throw new errors_js_1.BoxSdkError({ message: 'Expecting string for "next_marker" of type "IntegrationMappings"', }); } const nextMarker = val.next_marker == void 0 ? void 0 : val.next_marker; if (!(val.entries == void 0) && !(0, json_js_3.sdIsList)(val.entries)) { throw new errors_js_1.BoxSdkError({ message: 'Expecting array for "entries" of type "IntegrationMappings"', }); } const entries = val.entries == void 0 ? void 0 : (0, json_js_3.sdIsList)(val.entries) ? val.entries.map(function (itm) { return (0, integrationMapping_generated_js_2.deserializeIntegrationMapping)(itm); }) : []; return { limit: limit, nextMarker: nextMarker, entries: entries, }; } //# sourceMappingURL=integrationMappings.generated.js.map