-
Notifications
You must be signed in to change notification settings - Fork 4
/
issue.go
288 lines (247 loc) · 9.41 KB
/
issue.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
// This file was auto-generated by Fern from our API Definition.
package api
import (
fmt "fmt"
time "time"
)
type IssueCountRequest struct {
Id []*string `json:"-" url:"id,omitempty"`
IssueTriggerId []*string `json:"-" url:"issue_trigger_id,omitempty"`
Type *IssueCountRequestType `json:"-" url:"type,omitempty"`
Status *IssueCountRequestStatus `json:"-" url:"status,omitempty"`
MergedWith []*string `json:"-" url:"merged_with,omitempty"`
CreatedAt *time.Time `json:"-" url:"created_at,omitempty"`
FirstSeenAt *time.Time `json:"-" url:"first_seen_at,omitempty"`
LastSeenAt *time.Time `json:"-" url:"last_seen_at,omitempty"`
DismissedAt *time.Time `json:"-" url:"dismissed_at,omitempty"`
OrderBy *IssueCountRequestOrderBy `json:"-" url:"order_by,omitempty"`
Dir *IssueCountRequestDir `json:"-" url:"dir,omitempty"`
Limit *int `json:"-" url:"limit,omitempty"`
Next *string `json:"-" url:"next,omitempty"`
Prev *string `json:"-" url:"prev,omitempty"`
}
type IssueListRequest struct {
Id []*string `json:"-" url:"id,omitempty"`
IssueTriggerId []*string `json:"-" url:"issue_trigger_id,omitempty"`
Type *IssueListRequestType `json:"-" url:"type,omitempty"`
Status *IssueListRequestStatus `json:"-" url:"status,omitempty"`
MergedWith []*string `json:"-" url:"merged_with,omitempty"`
CreatedAt *time.Time `json:"-" url:"created_at,omitempty"`
FirstSeenAt *time.Time `json:"-" url:"first_seen_at,omitempty"`
LastSeenAt *time.Time `json:"-" url:"last_seen_at,omitempty"`
DismissedAt *time.Time `json:"-" url:"dismissed_at,omitempty"`
OrderBy *IssueListRequestOrderBy `json:"-" url:"order_by,omitempty"`
Dir *IssueListRequestDir `json:"-" url:"dir,omitempty"`
Limit *int `json:"-" url:"limit,omitempty"`
Next *string `json:"-" url:"next,omitempty"`
Prev *string `json:"-" url:"prev,omitempty"`
}
type IssueCountRequestDir string
const (
IssueCountRequestDirAsc IssueCountRequestDir = "asc"
IssueCountRequestDirDesc IssueCountRequestDir = "desc"
)
func NewIssueCountRequestDirFromString(s string) (IssueCountRequestDir, error) {
switch s {
case "asc":
return IssueCountRequestDirAsc, nil
case "desc":
return IssueCountRequestDirDesc, nil
}
var t IssueCountRequestDir
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueCountRequestDir) Ptr() *IssueCountRequestDir {
return &i
}
type IssueCountRequestOrderBy string
const (
IssueCountRequestOrderByCreatedAt IssueCountRequestOrderBy = "created_at"
IssueCountRequestOrderByFirstSeenAt IssueCountRequestOrderBy = "first_seen_at"
IssueCountRequestOrderByLastSeenAt IssueCountRequestOrderBy = "last_seen_at"
IssueCountRequestOrderByOpenedAt IssueCountRequestOrderBy = "opened_at"
IssueCountRequestOrderByStatus IssueCountRequestOrderBy = "status"
)
func NewIssueCountRequestOrderByFromString(s string) (IssueCountRequestOrderBy, error) {
switch s {
case "created_at":
return IssueCountRequestOrderByCreatedAt, nil
case "first_seen_at":
return IssueCountRequestOrderByFirstSeenAt, nil
case "last_seen_at":
return IssueCountRequestOrderByLastSeenAt, nil
case "opened_at":
return IssueCountRequestOrderByOpenedAt, nil
case "status":
return IssueCountRequestOrderByStatus, nil
}
var t IssueCountRequestOrderBy
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueCountRequestOrderBy) Ptr() *IssueCountRequestOrderBy {
return &i
}
type IssueCountRequestStatus string
const (
IssueCountRequestStatusOpened IssueCountRequestStatus = "OPENED"
IssueCountRequestStatusIgnored IssueCountRequestStatus = "IGNORED"
IssueCountRequestStatusAcknowledged IssueCountRequestStatus = "ACKNOWLEDGED"
IssueCountRequestStatusResolved IssueCountRequestStatus = "RESOLVED"
)
func NewIssueCountRequestStatusFromString(s string) (IssueCountRequestStatus, error) {
switch s {
case "OPENED":
return IssueCountRequestStatusOpened, nil
case "IGNORED":
return IssueCountRequestStatusIgnored, nil
case "ACKNOWLEDGED":
return IssueCountRequestStatusAcknowledged, nil
case "RESOLVED":
return IssueCountRequestStatusResolved, nil
}
var t IssueCountRequestStatus
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueCountRequestStatus) Ptr() *IssueCountRequestStatus {
return &i
}
type IssueCountRequestType string
const (
IssueCountRequestTypeDelivery IssueCountRequestType = "delivery"
IssueCountRequestTypeTransformation IssueCountRequestType = "transformation"
IssueCountRequestTypeBackpressure IssueCountRequestType = "backpressure"
)
func NewIssueCountRequestTypeFromString(s string) (IssueCountRequestType, error) {
switch s {
case "delivery":
return IssueCountRequestTypeDelivery, nil
case "transformation":
return IssueCountRequestTypeTransformation, nil
case "backpressure":
return IssueCountRequestTypeBackpressure, nil
}
var t IssueCountRequestType
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueCountRequestType) Ptr() *IssueCountRequestType {
return &i
}
type IssueListRequestDir string
const (
IssueListRequestDirAsc IssueListRequestDir = "asc"
IssueListRequestDirDesc IssueListRequestDir = "desc"
)
func NewIssueListRequestDirFromString(s string) (IssueListRequestDir, error) {
switch s {
case "asc":
return IssueListRequestDirAsc, nil
case "desc":
return IssueListRequestDirDesc, nil
}
var t IssueListRequestDir
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueListRequestDir) Ptr() *IssueListRequestDir {
return &i
}
type IssueListRequestOrderBy string
const (
IssueListRequestOrderByCreatedAt IssueListRequestOrderBy = "created_at"
IssueListRequestOrderByFirstSeenAt IssueListRequestOrderBy = "first_seen_at"
IssueListRequestOrderByLastSeenAt IssueListRequestOrderBy = "last_seen_at"
IssueListRequestOrderByOpenedAt IssueListRequestOrderBy = "opened_at"
IssueListRequestOrderByStatus IssueListRequestOrderBy = "status"
)
func NewIssueListRequestOrderByFromString(s string) (IssueListRequestOrderBy, error) {
switch s {
case "created_at":
return IssueListRequestOrderByCreatedAt, nil
case "first_seen_at":
return IssueListRequestOrderByFirstSeenAt, nil
case "last_seen_at":
return IssueListRequestOrderByLastSeenAt, nil
case "opened_at":
return IssueListRequestOrderByOpenedAt, nil
case "status":
return IssueListRequestOrderByStatus, nil
}
var t IssueListRequestOrderBy
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueListRequestOrderBy) Ptr() *IssueListRequestOrderBy {
return &i
}
type IssueListRequestStatus string
const (
IssueListRequestStatusOpened IssueListRequestStatus = "OPENED"
IssueListRequestStatusIgnored IssueListRequestStatus = "IGNORED"
IssueListRequestStatusAcknowledged IssueListRequestStatus = "ACKNOWLEDGED"
IssueListRequestStatusResolved IssueListRequestStatus = "RESOLVED"
)
func NewIssueListRequestStatusFromString(s string) (IssueListRequestStatus, error) {
switch s {
case "OPENED":
return IssueListRequestStatusOpened, nil
case "IGNORED":
return IssueListRequestStatusIgnored, nil
case "ACKNOWLEDGED":
return IssueListRequestStatusAcknowledged, nil
case "RESOLVED":
return IssueListRequestStatusResolved, nil
}
var t IssueListRequestStatus
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueListRequestStatus) Ptr() *IssueListRequestStatus {
return &i
}
type IssueListRequestType string
const (
IssueListRequestTypeDelivery IssueListRequestType = "delivery"
IssueListRequestTypeTransformation IssueListRequestType = "transformation"
IssueListRequestTypeBackpressure IssueListRequestType = "backpressure"
)
func NewIssueListRequestTypeFromString(s string) (IssueListRequestType, error) {
switch s {
case "delivery":
return IssueListRequestTypeDelivery, nil
case "transformation":
return IssueListRequestTypeTransformation, nil
case "backpressure":
return IssueListRequestTypeBackpressure, nil
}
var t IssueListRequestType
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueListRequestType) Ptr() *IssueListRequestType {
return &i
}
// New status
type IssueUpdateRequestStatus string
const (
IssueUpdateRequestStatusOpened IssueUpdateRequestStatus = "OPENED"
IssueUpdateRequestStatusIgnored IssueUpdateRequestStatus = "IGNORED"
IssueUpdateRequestStatusAcknowledged IssueUpdateRequestStatus = "ACKNOWLEDGED"
IssueUpdateRequestStatusResolved IssueUpdateRequestStatus = "RESOLVED"
)
func NewIssueUpdateRequestStatusFromString(s string) (IssueUpdateRequestStatus, error) {
switch s {
case "OPENED":
return IssueUpdateRequestStatusOpened, nil
case "IGNORED":
return IssueUpdateRequestStatusIgnored, nil
case "ACKNOWLEDGED":
return IssueUpdateRequestStatusAcknowledged, nil
case "RESOLVED":
return IssueUpdateRequestStatusResolved, nil
}
var t IssueUpdateRequestStatus
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (i IssueUpdateRequestStatus) Ptr() *IssueUpdateRequestStatus {
return &i
}
type IssueUpdateRequest struct {
// New status
Status IssueUpdateRequestStatus `json:"status" url:"-"`
}