-
Notifications
You must be signed in to change notification settings - Fork 0
/
User.ts
30 lines (26 loc) · 874 Bytes
/
User.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
import BaseEntity from "./BaseEntity";
/**
* A class representing the information of a {@link User} stored by the broker.
*/
export class User extends BaseEntity {
/**
* The user's e-mail address.
*/
public email: string;
/**
* A constructor that creates a {@link User} object from a plain client object received from the broker.
* @param user - A plain object received from the broker with information about a {@link User}.
*/
constructor(user: any = {}) {
super(user);
}
/**
* It updates the current object with information from a plain object received from the broker.
* @param user - A plain object received from the broker with information about a {@link User}.
*/
public update(user: any): void {
super.update(user);
this.email = user.email;
}
}
export default User;