@@ -156,9 +156,10 @@ type ListMergeRequestsOptions struct {
156
156
Scope * string `url:"scope,omitempty" json:"scope,omitempty"`
157
157
AuthorID * int `url:"author_id,omitempty" json:"author_id,omitempty"`
158
158
AuthorUsername * string `url:"author_username,omitempty" json:"author_username,omitempty"`
159
- AssigneeID * int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
159
+ AssigneeID * AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
160
+ ApproverIDs * ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
160
161
ApprovedByIDs * ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"`
161
- ReviewerID * int `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
162
+ ReviewerID * ReviewerIDValue `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
162
163
ReviewerUsername * string `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
163
164
MyReactionEmoji * string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
164
165
SourceBranch * string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
@@ -191,51 +192,53 @@ func (s *MergeRequestsService) ListMergeRequests(opt *ListMergeRequestsOptions,
191
192
return m , resp , err
192
193
}
193
194
194
- // ListGroupMergeRequestsOptions represents the available ListGroupMergeRequests ()
195
+ // ListProjectMergeRequestsOptions represents the available ListMergeRequests ()
195
196
// options.
196
197
//
197
198
// GitLab API docs:
198
- // https://docs.gitlab.com/ce/api/merge_requests.html#list-group -merge-requests
199
- type ListGroupMergeRequestsOptions struct {
199
+ // https://docs.gitlab.com/ce/api/merge_requests.html#list-project -merge-requests
200
+ type ListProjectMergeRequestsOptions struct {
200
201
ListOptions
201
- State * string `url:"state,omitempty" json:"state,omitempty"`
202
- OrderBy * string `url:"order_by,omitempty" json:"order_by,omitempty"`
203
- Sort * string `url:"sort,omitempty" json:"sort,omitempty"`
204
- Milestone * string `url:"milestone,omitempty" json:"milestone,omitempty"`
205
- View * string `url:"view,omitempty" json:"view,omitempty"`
206
- Labels * Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
207
- NotLabels * Labels `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
208
- WithLabelsDetails * bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
209
- WithMergeStatusRecheck * bool `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,omitempty"`
210
- CreatedAfter * time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
211
- CreatedBefore * time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
212
- UpdatedAfter * time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
213
- UpdatedBefore * time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
214
- Scope * string `url:"scope,omitempty" json:"scope,omitempty"`
215
- AuthorID * int `url:"author_id,omitempty" json:"author_id,omitempty"`
216
- AuthorUsername * string `url:"author_username,omitempty" json:"author_username,omitempty"`
217
- AssigneeID * int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
218
- ReviewerID * int `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
219
- ReviewerUsername * string `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
220
- MyReactionEmoji * string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
221
- SourceBranch * string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
222
- TargetBranch * string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
223
- Search * string `url:"search,omitempty" json:"search,omitempty"`
224
- In * string `url:"in,omitempty" json:"in,omitempty"`
225
- Draft * bool `url:"draft,omitempty" json:"draft,omitempty"`
226
- WIP * string `url:"wip,omitempty" json:"wip,omitempty"`
202
+ IIDs * []int `url:"iids[],omitempty" json:"iids,omitempty"`
203
+ State * string `url:"state,omitempty" json:"state,omitempty"`
204
+ OrderBy * string `url:"order_by,omitempty" json:"order_by,omitempty"`
205
+ Sort * string `url:"sort,omitempty" json:"sort,omitempty"`
206
+ Milestone * string `url:"milestone,omitempty" json:"milestone,omitempty"`
207
+ View * string `url:"view,omitempty" json:"view,omitempty"`
208
+ Labels * Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
209
+ NotLabels * Labels `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
210
+ WithLabelsDetails * bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
211
+ WithMergeStatusRecheck * bool `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,omitempty"`
212
+ CreatedAfter * time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
213
+ CreatedBefore * time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
214
+ UpdatedAfter * time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
215
+ UpdatedBefore * time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
216
+ Scope * string `url:"scope,omitempty" json:"scope,omitempty"`
217
+ AuthorID * int `url:"author_id,omitempty" json:"author_id,omitempty"`
218
+ AuthorUsername * string `url:"author_username,omitempty" json:"author_username,omitempty"`
219
+ AssigneeID * AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
220
+ ApproverIDs * ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
221
+ ApprovedByIDs * ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"`
222
+ ReviewerID * ReviewerIDValue `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
223
+ ReviewerUsername * string `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
224
+ MyReactionEmoji * string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
225
+ SourceBranch * string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
226
+ TargetBranch * string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
227
+ Search * string `url:"search,omitempty" json:"search,omitempty"`
228
+ Draft * bool `url:"draft,omitempty" json:"draft,omitempty"`
229
+ WIP * string `url:"wip,omitempty" json:"wip,omitempty"`
227
230
}
228
231
229
- // ListGroupMergeRequests gets all merge requests for this group .
232
+ // ListProjectMergeRequests gets all merge requests for this project .
230
233
//
231
234
// GitLab API docs:
232
- // https://docs.gitlab.com/ce/api/merge_requests.html#list-group -merge-requests
233
- func (s * MergeRequestsService ) ListGroupMergeRequests ( gid interface {}, opt * ListGroupMergeRequestsOptions , options ... RequestOptionFunc ) ([]* MergeRequest , * Response , error ) {
234
- group , err := parseID (gid )
235
+ // https://docs.gitlab.com/ce/api/merge_requests.html#list-project -merge-requests
236
+ func (s * MergeRequestsService ) ListProjectMergeRequests ( pid interface {}, opt * ListProjectMergeRequestsOptions , options ... RequestOptionFunc ) ([]* MergeRequest , * Response , error ) {
237
+ project , err := parseID (pid )
235
238
if err != nil {
236
239
return nil , nil , err
237
240
}
238
- u := fmt .Sprintf ("groups /%s/merge_requests" , PathEscape (group ))
241
+ u := fmt .Sprintf ("projects /%s/merge_requests" , PathEscape (project ))
239
242
240
243
req , err := s .client .NewRequest (http .MethodGet , u , opt , options )
241
244
if err != nil {
@@ -251,51 +254,53 @@ func (s *MergeRequestsService) ListGroupMergeRequests(gid interface{}, opt *List
251
254
return m , resp , err
252
255
}
253
256
254
- // ListProjectMergeRequestsOptions represents the available ListMergeRequests ()
257
+ // ListGroupMergeRequestsOptions represents the available ListGroupMergeRequests ()
255
258
// options.
256
259
//
257
260
// GitLab API docs:
258
- // https://docs.gitlab.com/ce/api/merge_requests.html#list-project -merge-requests
259
- type ListProjectMergeRequestsOptions struct {
261
+ // https://docs.gitlab.com/ce/api/merge_requests.html#list-group -merge-requests
262
+ type ListGroupMergeRequestsOptions struct {
260
263
ListOptions
261
- IIDs * []int `url:"iids[],omitempty" json:"iids,omitempty"`
262
- State * string `url:"state,omitempty" json:"state,omitempty"`
263
- OrderBy * string `url:"order_by,omitempty" json:"order_by,omitempty"`
264
- Sort * string `url:"sort,omitempty" json:"sort,omitempty"`
265
- Milestone * string `url:"milestone,omitempty" json:"milestone,omitempty"`
266
- View * string `url:"view,omitempty" json:"view,omitempty"`
267
- Labels * Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
268
- NotLabels * Labels `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
269
- WithLabelsDetails * bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
270
- WithMergeStatusRecheck * bool `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,omitempty"`
271
- CreatedAfter * time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
272
- CreatedBefore * time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
273
- UpdatedAfter * time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
274
- UpdatedBefore * time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
275
- Scope * string `url:"scope,omitempty" json:"scope,omitempty"`
276
- AuthorID * int `url:"author_id,omitempty" json:"author_id,omitempty"`
277
- AuthorUsername * string `url:"author_username,omitempty" json:"author_username,omitempty"`
278
- AssigneeID * int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
279
- ReviewerID * int `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
280
- ReviewerUsername * string `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
281
- MyReactionEmoji * string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
282
- SourceBranch * string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
283
- TargetBranch * string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
284
- Search * string `url:"search,omitempty" json:"search,omitempty"`
285
- Draft * bool `url:"draft,omitempty" json:"draft,omitempty"`
286
- WIP * string `url:"wip,omitempty" json:"wip,omitempty"`
264
+ State * string `url:"state,omitempty" json:"state,omitempty"`
265
+ OrderBy * string `url:"order_by,omitempty" json:"order_by,omitempty"`
266
+ Sort * string `url:"sort,omitempty" json:"sort,omitempty"`
267
+ Milestone * string `url:"milestone,omitempty" json:"milestone,omitempty"`
268
+ View * string `url:"view,omitempty" json:"view,omitempty"`
269
+ Labels * Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
270
+ NotLabels * Labels `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
271
+ WithLabelsDetails * bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
272
+ WithMergeStatusRecheck * bool `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,omitempty"`
273
+ CreatedAfter * time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
274
+ CreatedBefore * time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
275
+ UpdatedAfter * time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
276
+ UpdatedBefore * time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
277
+ Scope * string `url:"scope,omitempty" json:"scope,omitempty"`
278
+ AuthorID * int `url:"author_id,omitempty" json:"author_id,omitempty"`
279
+ AuthorUsername * string `url:"author_username,omitempty" json:"author_username,omitempty"`
280
+ AssigneeID * AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
281
+ ApproverIDs * ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
282
+ ApprovedByIDs * ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"`
283
+ ReviewerID * ReviewerIDValue `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
284
+ ReviewerUsername * string `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
285
+ MyReactionEmoji * string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
286
+ SourceBranch * string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
287
+ TargetBranch * string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
288
+ Search * string `url:"search,omitempty" json:"search,omitempty"`
289
+ In * string `url:"in,omitempty" json:"in,omitempty"`
290
+ Draft * bool `url:"draft,omitempty" json:"draft,omitempty"`
291
+ WIP * string `url:"wip,omitempty" json:"wip,omitempty"`
287
292
}
288
293
289
- // ListProjectMergeRequests gets all merge requests for this project .
294
+ // ListGroupMergeRequests gets all merge requests for this group .
290
295
//
291
296
// GitLab API docs:
292
- // https://docs.gitlab.com/ce/api/merge_requests.html#list-project -merge-requests
293
- func (s * MergeRequestsService ) ListProjectMergeRequests ( pid interface {}, opt * ListProjectMergeRequestsOptions , options ... RequestOptionFunc ) ([]* MergeRequest , * Response , error ) {
294
- project , err := parseID (pid )
297
+ // https://docs.gitlab.com/ce/api/merge_requests.html#list-group -merge-requests
298
+ func (s * MergeRequestsService ) ListGroupMergeRequests ( gid interface {}, opt * ListGroupMergeRequestsOptions , options ... RequestOptionFunc ) ([]* MergeRequest , * Response , error ) {
299
+ group , err := parseID (gid )
295
300
if err != nil {
296
301
return nil , nil , err
297
302
}
298
- u := fmt .Sprintf ("projects /%s/merge_requests" , PathEscape (project ))
303
+ u := fmt .Sprintf ("groups /%s/merge_requests" , PathEscape (group ))
299
304
300
305
req , err := s .client .NewRequest (http .MethodGet , u , opt , options )
301
306
if err != nil {
0 commit comments