-
Notifications
You must be signed in to change notification settings - Fork 2
/
events.go
75 lines (66 loc) · 2.13 KB
/
events.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
package main
type Event struct {
Ref string `json:"ref,omitempty"`
// The pull request itself.
PullRequest PullRequest `json:"pull_request,omitempty"`
// The user who pushed the commits.
Pusher Pusher `json:"pusher,omitempty"`
// The action performed. Can be created, edited, or deleted.
Action string `json:"action,omitempty"`
// The commit comment resource.
Comment Comment `json:"comment,omitempty"`
// Commits
Commits []Commit `json:"commits,omitempty"`
// The discussion resource.
Discussion Discussion `json:"discussion,omitempty"`
// The issue the comment belongs to.
Issue Issue `json:"issue,omitempty"`
// The repository where the event occurred.
Repository Repository `json:"repository"`
// The user that triggered the event.
Sender User `json:"sender"`
// URL that shows the changes in this ref update, from the before commit to the after commit.
// For a newly created ref that is directly based on the default branch, this is the comparison between the head of the default branch and the after commit.
// Otherwise, this shows all commits until the after commit.
Compare string `json:"compare,omitempty"`
}
type Commit struct {
Message string `json:"message"`
Url string `json:"url"`
}
type Pusher struct {
Name string `json:"name"`
Email string `json:"email,omitempty"`
}
type PullRequest struct {
Title string `json:"title"`
Url string `json:"html_url"`
IssueUrl string `json:"issue_url,omitempty"`
Number int `json:"number"`
}
type Issue struct {
Title string `json:"title"`
Url string `json:"html_url"`
Number int `json:"number"`
User User `json:"user,omitempty"`
}
type Repository struct {
Name string `json:"name"`
Private bool `json:"private"`
Url string `json:"html_url"`
}
type Discussion struct {
Title string `json:"title"`
Url string `json:"html_url"`
Number int `json:"number"`
User User `json:"user,omitempty"`
}
type Comment struct {
Url string `json:"html_url,omitempty"`
User User `json:"user,omitempty"`
}
type User struct {
Name string `json:"login,omitempty"`
Url string `json:"html_url,omitempty"`
Type string `json:"type,omitempty"`
}