"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeIntegrationMappingTeamsCreateRequest = serializeIntegrationMappingTeamsCreateRequest;
exports.deserializeIntegrationMappingTeamsCreateRequest = deserializeIntegrationMappingTeamsCreateRequest;
const integrationMappingPartnerItemTeamsCreateRequest_1 = require("./integrationMappingPartnerItemTeamsCreateRequest");
const integrationMappingPartnerItemTeamsCreateRequest_2 = require("./integrationMappingPartnerItemTeamsCreateRequest");
const folderReference_1 = require("./folderReference");
const folderReference_2 = require("./folderReference");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
function serializeIntegrationMappingTeamsCreateRequest(val) {
    return {
        ['partner_item']: (0, integrationMappingPartnerItemTeamsCreateRequest_1.serializeIntegrationMappingPartnerItemTeamsCreateRequest)(val.partnerItem),
        ['box_item']: (0, folderReference_1.serializeFolderReference)(val.boxItem),
    };
}
function deserializeIntegrationMappingTeamsCreateRequest(val) {
    if (!(0, json_1.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "IntegrationMappingTeamsCreateRequest"',
        });
    }
    if (val.partner_item == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "partner_item" of type "IntegrationMappingTeamsCreateRequest" to be defined',
        });
    }
    const partnerItem = (0, integrationMappingPartnerItemTeamsCreateRequest_2.deserializeIntegrationMappingPartnerItemTeamsCreateRequest)(val.partner_item);
    if (val.box_item == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "box_item" of type "IntegrationMappingTeamsCreateRequest" to be defined',
        });
    }
    const boxItem = (0, folderReference_2.deserializeFolderReference)(val.box_item);
    return {
        partnerItem: partnerItem,
        boxItem: boxItem,
    };
}
//# sourceMappingURL=integrationMappingTeamsCreateRequest.js.map