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