-
Notifications
You must be signed in to change notification settings - Fork 7
/
user.go
77 lines (67 loc) · 1.41 KB
/
user.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
72
73
74
75
76
77
package yext
import (
"encoding/json"
)
type User struct {
Id *string `json:"id,omitempty"` // req in post
FirstName *string `json:"firstName,omitempty"` // req in post
LastName *string `json:"lastName,omitempty"` // req in post
UserName *string `json:"username,omitempty"`
EmailAddress *string `json:"emailAddress,omitempty"` // req in post
PhoneNumber *string `json:"phoneNumber,omitempty"`
Password *string `json:"password,omitempty"`
SSO *bool `json:"sso,omitempty"`
ACLs []ACL `json:"acl,omitempty"`
}
func (u *User) GetId() string {
if u.Id == nil {
return ""
}
return *u.Id
}
func (u *User) GetFirstName() string {
if u.FirstName == nil {
return ""
}
return *u.FirstName
}
func (u *User) GetLastName() string {
if u.LastName == nil {
return ""
}
return *u.LastName
}
func (u *User) GetUserName() string {
if u.UserName == nil {
return ""
}
return *u.UserName
}
func (u *User) GetEmailAddress() string {
if u.EmailAddress == nil {
return ""
}
return *u.EmailAddress
}
func (u *User) GetPhoneNumber() string {
if u.PhoneNumber == nil {
return ""
}
return *u.PhoneNumber
}
func (u *User) GetPassword() string {
if u.Password == nil {
return ""
}
return *u.Password
}
func (u *User) GetSSO() bool {
if u.SSO == nil {
return false
}
return *u.SSO
}
func (u *User) String() string {
b, _ := json.Marshal(u)
return string(b)
}