"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeIntegrationMappingSlackCreateRequest = serializeIntegrationMappingSlackCreateRequest;
exports.deserializeIntegrationMappingSlackCreateRequest = deserializeIntegrationMappingSlackCreateRequest;
const integrationMappingPartnerItemSlack_1 = require("./integrationMappingPartnerItemSlack");
const integrationMappingPartnerItemSlack_2 = require("./integrationMappingPartnerItemSlack");
const integrationMappingBoxItemSlack_1 = require("./integrationMappingBoxItemSlack");
const integrationMappingBoxItemSlack_2 = require("./integrationMappingBoxItemSlack");
const integrationMappingSlackOptions_1 = require("./integrationMappingSlackOptions");
const integrationMappingSlackOptions_2 = require("./integrationMappingSlackOptions");
const errors_1 = require("../box/errors");
const json_1 = require("../serialization/json");
function serializeIntegrationMappingSlackCreateRequest(val) {
    return {
        ['partner_item']: (0, integrationMappingPartnerItemSlack_1.serializeIntegrationMappingPartnerItemSlack)(val.partnerItem),
        ['box_item']: (0, integrationMappingBoxItemSlack_1.serializeIntegrationMappingBoxItemSlack)(val.boxItem),
        ['options']: val.options == void 0
            ? val.options
            : (0, integrationMappingSlackOptions_1.serializeIntegrationMappingSlackOptions)(val.options),
    };
}
function deserializeIntegrationMappingSlackCreateRequest(val) {
    if (!(0, json_1.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "IntegrationMappingSlackCreateRequest"',
        });
    }
    if (val.partner_item == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "partner_item" of type "IntegrationMappingSlackCreateRequest" to be defined',
        });
    }
    const partnerItem = (0, integrationMappingPartnerItemSlack_2.deserializeIntegrationMappingPartnerItemSlack)(val.partner_item);
    if (val.box_item == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "box_item" of type "IntegrationMappingSlackCreateRequest" to be defined',
        });
    }
    const boxItem = (0, integrationMappingBoxItemSlack_2.deserializeIntegrationMappingBoxItemSlack)(val.box_item);
    const options = val.options == void 0
        ? void 0
        : (0, integrationMappingSlackOptions_2.deserializeIntegrationMappingSlackOptions)(val.options);
    return {
        partnerItem: partnerItem,
        boxItem: boxItem,
        options: options,
    };
}
//# sourceMappingURL=integrationMappingSlackCreateRequest.js.map