import { UserService } from '../../../../core/backend-api/index.js';
import { tryExecute } from '../../../../core/resources/index.js';
/**
 * A server data source for enabling users
 * @class UmbEnableUserServerDataSource
 */
export class UmbEnableUserServerDataSource {
    #host;
    /**
     * Creates an instance of UmbEnableUserServerDataSource.
     * @param {UmbControllerHost} host - The controller host for this controller to be appended to
     * @memberof UmbEnableUserServerDataSource
     */
    constructor(host) {
        this.#host = host;
    }
    /**
     * Enables the specified user ids
     * @param {string[]} userIds
     * @returns {Promise<void>}
     * @memberof UmbEnableUserServerDataSource
     */
    async enable(userIds) {
        if (!userIds)
            throw new Error('User ids are missing');
        return tryExecute(this.#host, UserService.postUserEnable({
            body: {
                userIds: userIds.map((id) => ({ id })),
            },
        }));
    }
}
