"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPIService_1 = require("./BaseAPIService");
const Services_1 = require("./Services");
class UserService extends BaseAPIService_1.default {
    constructor(baseURL, token) {
        super(baseURL, 'users', token);
    }
    me() {
        const _super = Object.create(null, {
            get: { get: () => super.get }
        });
        return __awaiter(this, void 0, void 0, function* () {
            return _super.get.call(this, 'me');
        });
    }
    exists(email) {
        const _super = Object.create(null, {
            get: { get: () => super.get }
        });
        return __awaiter(this, void 0, void 0, function* () {
            return _super.get.call(this, `${email}/exists`);
        });
    }
    invite(account, email) {
        const _super = Object.create(null, {
            postNoPayload: { get: () => super.postNoPayload }
        });
        return __awaiter(this, void 0, void 0, function* () {
            return _super.postNoPayload.call(this, `account/${account}/invite-user/${email}`);
        });
    }
    revoke(account, email) {
        const _super = Object.create(null, {
            delete: { get: () => super.delete }
        });
        return __awaiter(this, void 0, void 0, function* () {
            return _super.delete.call(this, `account/${account}/invite-user/${email}`);
        });
    }
    accountUsers(accountId) {
        const _super = Object.create(null, {
            listByPath: { get: () => super.listByPath }
        });
        return __awaiter(this, void 0, void 0, function* () {
            return _super.listByPath.call(this, `/customer/${accountId}`);
        });
    }
    orgUsers(orgId) {
        const _super = Object.create(null, {
            listByPath: { get: () => super.listByPath }
        });
        return __awaiter(this, void 0, void 0, function* () {
            return _super.listByPath.call(this, `/account/${orgId}`);
        });
    }
    device(userId) {
        return new Services_1.UserDeviceService(this.baseURL, this.token, userId);
    }
}
exports.default = UserService;
