-
Notifications
You must be signed in to change notification settings - Fork 0
/
members.go
71 lines (61 loc) · 1.25 KB
/
members.go
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
61
62
63
64
65
66
67
68
69
70
71
package clickup
type Member struct {
User *User `json:"user,omitempty"`
}
func (m *Member) GetUser() *User {
if m == nil {
return nil
}
return m.User
}
type User struct {
ID *int `json:"id,omitempty"`
Username *string `json:"username,omitempty"`
Email *string `json:"email,omitempty"`
Color *string `json:"color,omitempty"`
ProfilePicture *string `json:"profilePicture,omitempty"`
Initials *string `json:"initials,omitempty"`
Role *int `json:"role,omitempty"`
}
func (u *User) GetID() int {
if u == nil || u.ID == nil {
return -1
}
return *u.ID
}
func (u *User) GetUsername() string {
if u == nil || u.Username == nil {
return ""
}
return *u.Username
}
func (u *User) GetEmail() string {
if u == nil || u.Email == nil {
return ""
}
return *u.Email
}
func (u *User) GetColor() string {
if u == nil || u.Color == nil {
return ""
}
return *u.Color
}
func (u *User) GetProfilePicture() string {
if u == nil || u.ProfilePicture == nil {
return ""
}
return *u.Color
}
func (u *User) GetInitials() string {
if u == nil || u.Initials == nil {
return ""
}
return *u.Initials
}
func (u *User) GetRole() int {
if u == nil || u.Role == nil {
return -1
}
return *u.Role
}