"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeExternalUsersSubmitDeleteJobRequestV2025R0 = serializeExternalUsersSubmitDeleteJobRequestV2025R0;
exports.deserializeExternalUsersSubmitDeleteJobRequestV2025R0 = deserializeExternalUsersSubmitDeleteJobRequestV2025R0;
const userReferenceV2025R0_1 = require("./userReferenceV2025R0");
const userReferenceV2025R0_2 = require("./userReferenceV2025R0");
const errors_1 = require("../../box/errors");
const json_1 = require("../../serialization/json");
const json_2 = require("../../serialization/json");
function serializeExternalUsersSubmitDeleteJobRequestV2025R0(val) {
    return {
        ['external_users']: val.externalUsers.map(function (item) {
            return (0, userReferenceV2025R0_1.serializeUserReferenceV2025R0)(item);
        }),
    };
}
function deserializeExternalUsersSubmitDeleteJobRequestV2025R0(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "ExternalUsersSubmitDeleteJobRequestV2025R0"',
        });
    }
    if (val.external_users == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "external_users" of type "ExternalUsersSubmitDeleteJobRequestV2025R0" to be defined',
        });
    }
    if (!(0, json_1.sdIsList)(val.external_users)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting array for "external_users" of type "ExternalUsersSubmitDeleteJobRequestV2025R0"',
        });
    }
    const externalUsers = (0, json_1.sdIsList)(val.external_users)
        ? val.external_users.map(function (itm) {
            return (0, userReferenceV2025R0_2.deserializeUserReferenceV2025R0)(itm);
        })
        : [];
    return {
        externalUsers: externalUsers,
    };
}
//# sourceMappingURL=externalUsersSubmitDeleteJobRequestV2025R0.js.map