-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.go
More file actions
103 lines (92 loc) · 2.61 KB
/
api.go
File metadata and controls
103 lines (92 loc) · 2.61 KB
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
package bapi
type PullRequestStatus int
func (status PullRequestStatus) String() string {
switch status {
case PullRequestOpen:
return "OPEN"
case PullRequestDeclined:
return "DECLINED"
case PullRequestMerged:
return "MERGED"
}
panic("invalid status")
}
const (
PullRequestOpen PullRequestStatus = iota
PullRequestMerged
PullRequestDeclined
)
type PullRequestList struct {
Pagelen int `json:"pagelen"`
Page int `json:"page"`
Size int `json:"size"`
Links Links `json:"links"`
PullRequests []struct {
Id int `json:"id"`
Description string `json:"description"`
Title string `json:"title"`
State string `json:"state"`
CreatedOn string `json:"created_on"`
UpdatedOn string `json:"updated_on"`
Type string `json:"type"`
Author Author `json:"author"`
Destination Destination `json:"destination"`
Source Source `json:"source"`
} `json:"values"`
}
type PullRequest struct {
Description string `json:"description"`
Title string `json:"title"`
Links Links `json:"links"`
CloseSourceBranch bool `json:"close_source_branch"`
Reviewers Reviewer `json:"reviewers"`
MergeCommit string `json:"merge_commit"`
Reason string `json:"reason"`
ClosedBy string `json:"closed_by"`
Source Source `json:"source"`
State string `json:"state"`
Author Author `json:"author"`
CreatedOn string `json:"created_on"`
UpdatedOn string `json:"updated_on"`
Type string `json:"type"`
Id int `json:"id"`
Destination Destination `json:"destination"`
Participants []Participant `json:"participants"`
}
type Participant struct {
Role string `json:"role"`
User Author `json:"user"`
Approved bool `json:"approved"`
}
type Author struct {
Username string `json:"username"`
DisplayName string `json:"display_name"`
Type string `json:"type"`
UUID string `json:"uuid"`
}
type Links struct {
Decline Link `json:"decline"`
Commits Link `json:"commits"`
Self Link `json:"self"`
Comments Link `json:"comments"`
Merge Link `json:"merge"`
Html Link `json:"html"`
Activity Link `json:"activity"`
Diff Link `json:"diff"`
Approve Link `json:"approve"`
}
type Link struct {
Href string `json:"href"`
}
type Reviewer struct {
}
type Destination struct {
Branch struct {
Name string `json:"name"`
} `json:"branch"`
}
type Source struct {
Branch struct {
Name string `json:"name"`
} `json:"branch"`
}