"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports._unprotectAndRemoveGroup = _unprotectAndRemoveGroup;
const fail_safe_1 = require("../utils/fail-safe");
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
/**
 * Unprotect and Remove a Group.
 * Assumed caller has checked that the current user should be able
 * to unprotect and remove the group. Underlying calls are failsafe
 * so a failure to unprotect or remove the group will not reject
 * @param {IUserGroupOptions} userGroupOptions id and authentication
 * @private
 */
function _unprotectAndRemoveGroup(userGroupOptions) {
    const failSafeUnprotect = (0, fail_safe_1.failSafe)(arcgis_rest_portal_1.unprotectGroup, { success: true });
    const failSafeRemove = (0, fail_safe_1.failSafe)(arcgis_rest_portal_1.removeGroup, { success: true });
    return failSafeUnprotect(userGroupOptions).then(() => {
        return failSafeRemove(userGroupOptions);
    });
}
//# sourceMappingURL=_unprotect-and-remove-group.js.map