-
Notifications
You must be signed in to change notification settings - Fork 0
/
objects_common.go
86 lines (77 loc) · 3.38 KB
/
objects_common.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
78
79
80
81
82
83
84
85
86
package pubnub
// PNUser is the Objects API user struct
type PNUser struct {
ID string `json:"id"`
Name string `json:"name"`
ExternalID string `json:"externalId"`
ProfileURL string `json:"profileUrl"`
Email string `json:"email"`
Created string `json:"created"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
}
// PNSpace is the Objects API space struct
type PNSpace struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Created string `json:"created"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
}
// PNMembers is the Objects API Members struct
type PNMembers struct {
ID string `json:"id"`
User PNUser `json:"user"`
Created string `json:"created"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
}
// PNMemberships is the Objects API Memberships struct
type PNMemberships struct {
ID string `json:"id"`
Space PNSpace `json:"space"`
Created string `json:"created"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
}
// PNMembersInput is the Objects API Members input struct used to add members
type PNMembersInput struct {
ID string `json:"id"`
Custom map[string]interface{} `json:"custom"`
}
// PNMembersRemove is the Objects API Members struct used to remove members
type PNMembersRemove struct {
ID string `json:"id"`
}
// PNMembershipsInput is the Objects API Memberships input struct used to add members
type PNMembershipsInput struct {
ID string `json:"id"`
Custom map[string]interface{} `json:"custom"`
}
// PNMembershipsRemove is the Objects API Memberships struct used to remove members
type PNMembershipsRemove struct {
ID string `json:"id"`
}
// PNObjectsResponse is the Objects API collective Response struct of all methods.
type PNObjectsResponse struct {
Event PNObjectsEvent `json:"event"` // enum value
EventType PNObjectsEventType `json:"type"` // enum value
Name string `json:"name"`
UserID string `json:"userId"` // the user id if user related
SpaceID string `json:"spaceId"` // the space id if space related
Description string `json:"description"` // the description of what happened
Timestamp string `json:"timestamp"` // the timetoken of the event
ExternalID string `json:"externalId"`
ProfileURL string `json:"profileUrl"`
Email string `json:"email"`
Created string `json:"created"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
Data map[string]interface{} `json:"data"`
}