-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
58 lines (50 loc) · 1.59 KB
/
types.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
package central
import (
"time"
)
type Role string
const (
RoleNone Role = ""
RoleAdmin Role = "admin"
RolePartner Role = "partner"
RoleUser Role = "user"
)
type Organization struct {
ID int `json:"id"`
ParentID *int `json:"parent_id"`
Title string `json:"title"`
Path string `json:"path"`
Realm string `json:"realm"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Organizations []Organization `json:"organizations"`
}
type Application struct {
ID int `json:"id"`
Name string `json:"name"`
WriteAccess bool `json:"write_access"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
Organization *Organization `json:"organization"`
}
type User struct {
ID int `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
IdentityID int `json:"identity_id"`
Admin bool `json:"admin"`
}
type Membership struct {
ID int `json:"id"`
Role Role `json:"role"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
OrganizationID int `json:"organization_id"`
User *User `json:"user"`
Organization *Organization `json:"organization"`
}
type EffectiveRole struct {
Role Role `json:"role"`
Organization *Organization `json:"organization"`
}