-
-
Notifications
You must be signed in to change notification settings - Fork 334
/
types.go
221 lines (207 loc) · 6.54 KB
/
types.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
// Copyright 2018 Drone.IO Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package internal
type User struct {
Active bool `json:"active"`
DisplayName string `json:"displayName"`
EmailAddress string `json:"emailAddress"`
ID int `json:"id"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
Name string `json:"name"`
Slug string `json:"slug"`
Type string `json:"type"`
}
type CloneLink struct {
Href string `json:"href"`
Name string `json:"name"`
}
type SelfRefLink struct {
Href string `json:"href"`
}
type BuildStatus struct {
State string `json:"state"`
Key string `json:"key"`
Name string `json:"name,omitempty"`
URL string `json:"url"`
Desc string `json:"description,omitempty"`
}
type Repo struct {
Forkable bool `json:"forkable"`
ID int `json:"id"`
Links struct {
Clone []CloneLink `json:"clone"`
Self []struct {
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
Name string `json:"name"`
Project struct {
Description string `json:"description"`
ID int `json:"id"`
Key string `json:"key"`
Links struct {
Self []SelfRefLink `json:"self"`
} `json:"links"`
Name string `json:"name"`
Public bool `json:"public"`
Type string `json:"type"`
} `json:"project"`
Public bool `json:"public"`
ScmID string `json:"scmId"`
Slug string `json:"slug"`
State string `json:"state"`
StatusMessage string `json:"statusMessage"`
}
type Repos struct {
IsLastPage bool `json:"isLastPage"`
Limit int `json:"limit"`
Size int `json:"size"`
Start int `json:"start"`
Values []*Repo `json:"values"`
}
type Hook struct {
Enabled bool `json:"enabled"`
Details *HookDetail `json:"details"`
}
type HookDetail struct {
Key string `json:"key"`
Name string `json:"name"`
Type string `json:"type"`
Description string `json:"description"`
Version string `json:"version"`
ConfigFormKey string `json:"configFormKey"`
}
type Value struct {
Changes struct {
Filter interface{} `json:"filter"`
IsLastPage bool `json:"isLastPage"`
Limit int `json:"limit"`
Size int `json:"size"`
Start int `json:"start"`
Values []struct {
ContentID string `json:"contentId"`
Executable bool `json:"executable"`
Link struct {
Rel string `json:"rel"`
URL string `json:"url"`
} `json:"link"`
NodeType string `json:"nodeType"`
Path struct {
Components []string `json:"components"`
Extension string `json:"extension"`
Name string `json:"name"`
Parent string `json:"parent"`
ToString string `json:"toString"`
} `json:"path"`
PercentUnchanged int `json:"percentUnchanged"`
SrcExecutable bool `json:"srcExecutable"`
Type string `json:"type"`
} `json:"values"`
} `json:"changes"`
FromCommit struct {
DisplayID string `json:"displayId"`
ID string `json:"id"`
} `json:"fromCommit"`
Link struct {
Rel string `json:"rel"`
URL string `json:"url"`
} `json:"link"`
ToCommit struct {
Author struct {
EmailAddress string `json:"emailAddress"`
Name string `json:"name"`
} `json:"author"`
AuthorTimestamp int `json:"authorTimestamp"`
DisplayID string `json:"displayId"`
ID string `json:"id"`
Message string `json:"message"`
Parents []struct {
DisplayID string `json:"displayId"`
ID string `json:"id"`
} `json:"parents"`
} `json:"toCommit"`
}
type PostHook struct {
Changesets struct {
Filter interface{} `json:"filter"`
IsLastPage bool `json:"isLastPage"`
Limit int `json:"limit"`
Size int `json:"size"`
Start int `json:"start"`
Values []Value `json:"values"`
} `json:"changesets"`
RefChanges []RefChange `json:"refChanges"`
Repository struct {
Forkable bool `json:"forkable"`
ID int `json:"id"`
Name string `json:"name"`
Project struct {
ID int `json:"id"`
IsPersonal bool `json:"isPersonal"`
Key string `json:"key"`
Name string `json:"name"`
Public bool `json:"public"`
Type string `json:"type"`
} `json:"project"`
Public bool `json:"public"`
ScmID string `json:"scmId"`
Slug string `json:"slug"`
State string `json:"state"`
StatusMessage string `json:"statusMessage"`
} `json:"repository"`
}
type RefChange struct {
FromHash string `json:"fromHash"`
RefID string `json:"refId"`
ToHash string `json:"toHash"`
Type string `json:"type"`
}
type HookPluginDetails struct {
Details struct {
Key string `json:"key"`
Name string `json:"name"`
Type string `json:"type"`
Description string `json:"description"`
Version string `json:"version"`
ConfigFormKey string `json:"configFormKey"`
} `json:"details"`
Enabled bool `json:"enabled"`
Configured bool `json:"configured"`
}
type HookSettings struct {
HookURL0 string `json:"hook-url-0,omitempty"`
HookURL1 string `json:"hook-url-1,omitempty"`
HookURL2 string `json:"hook-url-2,omitempty"`
HookURL3 string `json:"hook-url-3,omitempty"`
HookURL4 string `json:"hook-url-4,omitempty"`
HookURL5 string `json:"hook-url-5,omitempty"`
HookURL6 string `json:"hook-url-6,omitempty"`
HookURL7 string `json:"hook-url-7,omitempty"`
HookURL8 string `json:"hook-url-8,omitempty"`
HookURL9 string `json:"hook-url-9,omitempty"`
HookURL10 string `json:"hook-url-10,omitempty"`
HookURL11 string `json:"hook-url-11,omitempty"`
HookURL12 string `json:"hook-url-12,omitempty"`
HookURL13 string `json:"hook-url-13,omitempty"`
HookURL14 string `json:"hook-url-14,omitempty"`
HookURL15 string `json:"hook-url-15,omitempty"`
HookURL16 string `json:"hook-url-16,omitempty"`
HookURL17 string `json:"hook-url-17,omitempty"`
HookURL18 string `json:"hook-url-18,omitempty"`
HookURL19 string `json:"hook-url-19,omitempty"`
}