-
Notifications
You must be signed in to change notification settings - Fork 62
/
objects_common.go
105 lines (92 loc) · 4.03 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package pubnub
// PNUUID is the Objects API user struct
type PNUUID struct {
ID string `json:"id"`
Name string `json:"name"`
ExternalID string `json:"externalId"`
ProfileURL string `json:"profileUrl"`
Email string `json:"email"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
}
// PNChannel is the Objects API space struct
type PNChannel struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
}
// PNChannelMembers is the Objects API Members struct
type PNChannelMembers struct {
ID string `json:"id"`
UUID PNUUID `json:"uuid"`
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"`
Channel PNChannel `json:"channel"`
Created string `json:"created"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
}
// PNChannelMembersUUID is the Objects API Members input struct used to add members
type PNChannelMembersUUID struct {
ID string `json:"id"`
}
// PNChannelMembersSet is the Objects API Members input struct used to add members
type PNChannelMembersSet struct {
UUID PNChannelMembersUUID `json:"uuid"`
Custom map[string]interface{} `json:"custom"`
}
// PNChannelMembersRemove is the Objects API Members struct used to remove members
type PNChannelMembersRemove struct {
UUID PNChannelMembersUUID `json:"uuid"`
}
// PNMembershipsChannel is the Objects API Memberships input struct used to add members
type PNMembershipsChannel struct {
ID string `json:"id"`
}
// PNMembershipsSet is the Objects API Memberships input struct used to add members
type PNMembershipsSet struct {
Channel PNMembershipsChannel `json:"channel"`
Custom map[string]interface{} `json:"custom"`
}
// PNMembershipsRemove is the Objects API Memberships struct used to remove members
type PNMembershipsRemove struct {
Channel PNMembershipsChannel `json:"channel"`
}
// 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"`
ID string `json:"id"` // the uuid if user related
Channel string `json:"channel"` // the channel 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"`
Updated string `json:"updated"`
ETag string `json:"eTag"`
Custom map[string]interface{} `json:"custom"`
Data map[string]interface{} `json:"data"`
}
// PNManageMembershipsBody is the Objects API input to add, remove or update membership
type PNManageMembershipsBody struct {
Set []PNMembershipsSet `json:"set"`
Remove []PNMembershipsRemove `json:"delete"`
}
// PNManageChannelMembersBody is the Objects API input to add, remove or update members
type PNManageChannelMembersBody struct {
Set []PNChannelMembersSet `json:"set"`
Remove []PNChannelMembersRemove `json:"delete"`
}