/
structs.go
103 lines (96 loc) · 3.6 KB
/
structs.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
// A yammer client.
package yammer
import (
oauth "github.com/dustin/goauth"
)
// User as returned from ListUsers, etc...
type User struct {
SO *string `json:"significant_other,omitempty"`
Schools []map[string]interface{} `json:"schools,omitempty"`
Stats map[string]int
URLs []string `json:"external_urls,omitempty"`
URL *string `json:"web_url,omitempty"`
Avatar *string `json:"mugshot_url,omitempty"`
Location *string `json:",omitempty"`
Timezone *string `json:",omitempty"`
YURL *string `json:"url,omitempty"`
Domains []string `json:"network_domains,omitempty"`
Kids *string `json:"kids_names,omitempty"`
PreviousCompanies []map[string]interface{} `json:"previous_companies,omitempty"`
FullName string `json:"full_name"`
Birthday *string `json:"birth_date,omitempty"`
Expertise *string `json:",omitempty"`
Summary *string `json:",omitempty"`
NetworkID int `json:"network_id,omitempty"`
Name string
NetworkName *string `json:"network_name,omitempty"`
Interests *string `json:",omitempty"`
Contact map[string]interface{}
HireDate *string `json:"hire_date,omitempty"`
ID int
CanBroadcast bool `json:"can_broadcast,string"`
Admin bool `json:"admin,string"`
JobTitle *string `json:"job_title,omitempty"`
}
// Group as returned from ListGroups, etc...
type Group struct {
Privacy string
URL string `json:"web_url"`
Stats map[string]interface{}
Avatar *string `json:"mugshot_url,omitempty"`
YURL *string `json:"url,omitempty"`
Description *string
FullName string `json:"full_name"`
Name string
ID int
CreatedAt *string `json:"created_at"`
}
// Message as returned from a message list API
type Message struct {
MessageType *string `json:"message_type"`
LikedBy struct {
Count int
Names []map[string]string
} `json:"liked_by"`
CreatedAt *string `json:"created_at"`
ThreadId int `json:"thread_id"`
APIURL *string `json:"url"`
NetworkID int `json:"network_id"`
Body struct {
Plain string
Parsed string
}
Privacy *string
ClientURL *string `json:"client_url"`
SenderType *string `json:"sender_type"`
ID int
SystemMessage bool `json:"system_message"`
Attachments []interface{}
SenderId int `json:"sender_id"`
RepliedTo *int `json:"replied_to_id"`
ClientType *string `json:"client_type"`
DirectMessage bool `json:"direct_message"`
YURL *string `json:"web_url"`
}
// A Network
type Network struct {
Notifications int `json:"unseen_message_count"`
Community bool
URL string `json:"web_url"`
Name string
PrivateUnseen int `json:"private_unseen_thread_count"`
Unseen int `json:"unseen_notification_count"`
Permalink string
}
// Message request object for PostMessage
type MessageRequest struct {
Body string // Message body (required)
GroupId int // The group to post to (optional)
ReplyTo int // Message in reply to (optional)
DirectTo int // ID of the user to whom this message is directed (optional)
Broadcast bool // True if an administrative broadcast
}
// The client.
type Client struct {
oauth oauth.OAuth
}