UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

71 lines 2.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeIntegrationMappingPartnerItemTeamsTypeField = serializeIntegrationMappingPartnerItemTeamsTypeField; exports.deserializeIntegrationMappingPartnerItemTeamsTypeField = deserializeIntegrationMappingPartnerItemTeamsTypeField; exports.serializeIntegrationMappingPartnerItemTeams = serializeIntegrationMappingPartnerItemTeams; exports.deserializeIntegrationMappingPartnerItemTeams = deserializeIntegrationMappingPartnerItemTeams; const errors_1 = require("../box/errors"); const json_1 = require("../serialization/json"); const json_2 = require("../serialization/json"); function serializeIntegrationMappingPartnerItemTeamsTypeField(val) { return val; } function deserializeIntegrationMappingPartnerItemTeamsTypeField(val) { if (val == 'channel') { return val; } if (val == 'team') { return val; } throw new errors_1.BoxSdkError({ message: "Can't deserialize IntegrationMappingPartnerItemTeamsTypeField", }); } function serializeIntegrationMappingPartnerItemTeams(val) { return { ['type']: serializeIntegrationMappingPartnerItemTeamsTypeField(val.type), ['id']: val.id, ['tenant_id']: val.tenantId, }; } function deserializeIntegrationMappingPartnerItemTeams(val) { if (!(0, json_2.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "IntegrationMappingPartnerItemTeams"', }); } if (val.type == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "type" of type "IntegrationMappingPartnerItemTeams" to be defined', }); } const type = deserializeIntegrationMappingPartnerItemTeamsTypeField(val.type); if (val.id == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "id" of type "IntegrationMappingPartnerItemTeams" to be defined', }); } if (!(0, json_1.sdIsString)(val.id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "id" of type "IntegrationMappingPartnerItemTeams"', }); } const id = val.id; if (val.tenant_id == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "tenant_id" of type "IntegrationMappingPartnerItemTeams" to be defined', }); } if (!(0, json_1.sdIsString)(val.tenant_id)) { throw new errors_1.BoxSdkError({ message: 'Expecting string for "tenant_id" of type "IntegrationMappingPartnerItemTeams"', }); } const tenantId = val.tenant_id; return { type: type, id: id, tenantId: tenantId, }; } //# sourceMappingURL=integrationMappingPartnerItemTeams.js.map