-
Notifications
You must be signed in to change notification settings - Fork 1
/
MPUserRole.ts
60 lines (56 loc) · 1.18 KB
/
MPUserRole.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* A User Role that allows certain parts of the data to be viewed.
*
* @export
* @class MPUserRole
* @typedef {MPUserRole}
*/
export default class MPUserRole {
/**
* Creates an instance of MPUserRole.
*
* @constructor
* @private
* @param {string} id The id of the user role.
* @param {string} name The name of the user role.
*/
private constructor(
public readonly id: string,
public readonly name: string,
) { }
/**
* Creator for MPUserRole, used to decode JSON from the MapsIndoors SDK.
*
* @public
* @static
* @param {MPUserRoleParams} object
* @returns {MPUserRole}
*/
public static create(object: MPUserRoleParams): MPUserRole {
return new MPUserRole(
object?.id,
object?.name,
);
}
}
/**
* Parameter interface for {@link MPUserRole}.
*
* @export
* @interface MPUserRoleParams
* @typedef {MPUserRoleParams}
*/
export interface MPUserRoleParams {
/**
* The id of the user role.
*
* @type {string}
*/
id: string,
/**
* The name of the user role.
*
* @type {string}
*/
name: string,
}