-
Notifications
You must be signed in to change notification settings - Fork 11
/
activity.go
38 lines (34 loc) · 1.01 KB
/
activity.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
package morpheus
var (
// ActivityPath is the API endpoint for activity
ActivityPath = "/api/activity"
)
// Activity structures for use in request and response payloads
type Activity struct {
ID string `json:"_id"`
Success bool `json:"success"`
ActivityType string `json:"activityType"`
Name string `json:"name"`
Message string `json:"message"`
ObjectType string `json:"objectType"`
ObjectId int64 `json:"objectId"`
User struct {
ID int64 `json:"id"`
UserName string `json:"username"`
} `json:"user"`
TS string `json:"ts"`
}
// GetActivityResult structure parses the list alerts response payload
type GetActivityResult struct {
Activity *[]Activity `json:"activity"`
Meta *MetaResult `json:"meta"`
}
// GetActivity get activity
func (client *Client) GetActivity(req *Request) (*Response, error) {
return client.Execute(&Request{
Method: "GET",
Path: ActivityPath,
QueryParams: req.QueryParams,
Result: &GetActivityResult{},
})
}