@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
74 lines • 2.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserCredentials = void 0;
const index_1 = require("./../index");
class UserCredentials {
constructor(data) {
let isAdminDefault = false;
this.isAdmin = typeof data.isAdmin !== "undefined" ? data.isAdmin : isAdminDefault;
let isUserDefault = true;
this.isUser = typeof data.isUser !== "undefined" ? data.isUser : isUserDefault;
let rolesDefault = [];
this.roles = typeof data.roles !== "undefined" ? data.roles : rolesDefault;
let uniqueIdDefault = "";
this.uniqueId = typeof data.uniqueId !== "undefined" ? data.uniqueId : uniqueIdDefault;
this.userLimits = index_1.Limits.fromJson(data.userLimits);
let userNameDefault = "";
this.userName = typeof data.userName !== "undefined" ? data.userName : userNameDefault;
}
static getIsAdminDefault() {
return false;
}
static getIsAdminDescription() {
return "true = An administration user";
}
static getIsUserDefault() {
return true;
}
static getIsUserDescription() {
return "true = A standard user";
}
static getRolesDefault() {
return [];
}
static getRolesDescription() {
return "Roles assigned to the user";
}
static getUniqueIdDefault() {
return "";
}
static getUniqueIdDescription() {
return "Unique ID for the user";
}
static getUserLimitsDescription() {
return "";
}
static getUserNameDefault() {
return "";
}
static getUserNameDescription() {
return "Name of the user";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new UserCredentials(data);
}
toJson() {
var _a;
return {
'isAdmin': this.isAdmin,
'isUser': this.isUser,
'roles': this.roles,
'uniqueId': this.uniqueId,
'userLimits': (_a = this.userLimits) === null || _a === void 0 ? void 0 : _a.toJson(),
'userName': this.userName,
};
}
clone() {
return UserCredentials.fromJson(this.toJson());
}
}
exports.UserCredentials = UserCredentials;
//# sourceMappingURL=UserCredentials.js.map