@@ -20,35 +20,36 @@ type PullRequestsService service
20
20
21
21
// PullRequest represents a GitHub pull request on a repository.
22
22
type PullRequest struct {
23
- ID * int `json:"id,omitempty"`
24
- Number * int `json:"number,omitempty"`
25
- State * string `json:"state,omitempty"`
26
- Title * string `json:"title,omitempty"`
27
- Body * string `json:"body,omitempty"`
28
- CreatedAt * time.Time `json:"created_at,omitempty"`
29
- UpdatedAt * time.Time `json:"updated_at,omitempty"`
30
- ClosedAt * time.Time `json:"closed_at,omitempty"`
31
- MergedAt * time.Time `json:"merged_at,omitempty"`
32
- User * User `json:"user,omitempty"`
33
- Merged * bool `json:"merged,omitempty"`
34
- Mergeable * bool `json:"mergeable,omitempty"`
35
- MergedBy * User `json:"merged_by,omitempty"`
36
- Comments * int `json:"comments,omitempty"`
37
- Commits * int `json:"commits,omitempty"`
38
- Additions * int `json:"additions,omitempty"`
39
- Deletions * int `json:"deletions,omitempty"`
40
- ChangedFiles * int `json:"changed_files,omitempty"`
41
- URL * string `json:"url,omitempty"`
42
- HTMLURL * string `json:"html_url,omitempty"`
43
- IssueURL * string `json:"issue_url,omitempty"`
44
- StatusesURL * string `json:"statuses_url,omitempty"`
45
- DiffURL * string `json:"diff_url,omitempty"`
46
- PatchURL * string `json:"patch_url,omitempty"`
47
- ReviewCommentsURL * string `json:"review_comments_url,omitempty"`
48
- ReviewCommentURL * string `json:"review_comment_url,omitempty"`
49
- Assignee * User `json:"assignee,omitempty"`
50
- Assignees []* User `json:"assignees,omitempty"`
51
- Milestone * Milestone `json:"milestone,omitempty"`
23
+ ID * int `json:"id,omitempty"`
24
+ Number * int `json:"number,omitempty"`
25
+ State * string `json:"state,omitempty"`
26
+ Title * string `json:"title,omitempty"`
27
+ Body * string `json:"body,omitempty"`
28
+ CreatedAt * time.Time `json:"created_at,omitempty"`
29
+ UpdatedAt * time.Time `json:"updated_at,omitempty"`
30
+ ClosedAt * time.Time `json:"closed_at,omitempty"`
31
+ MergedAt * time.Time `json:"merged_at,omitempty"`
32
+ User * User `json:"user,omitempty"`
33
+ Merged * bool `json:"merged,omitempty"`
34
+ Mergeable * bool `json:"mergeable,omitempty"`
35
+ MergedBy * User `json:"merged_by,omitempty"`
36
+ Comments * int `json:"comments,omitempty"`
37
+ Commits * int `json:"commits,omitempty"`
38
+ Additions * int `json:"additions,omitempty"`
39
+ Deletions * int `json:"deletions,omitempty"`
40
+ ChangedFiles * int `json:"changed_files,omitempty"`
41
+ URL * string `json:"url,omitempty"`
42
+ HTMLURL * string `json:"html_url,omitempty"`
43
+ IssueURL * string `json:"issue_url,omitempty"`
44
+ StatusesURL * string `json:"statuses_url,omitempty"`
45
+ DiffURL * string `json:"diff_url,omitempty"`
46
+ PatchURL * string `json:"patch_url,omitempty"`
47
+ ReviewCommentsURL * string `json:"review_comments_url,omitempty"`
48
+ ReviewCommentURL * string `json:"review_comment_url,omitempty"`
49
+ Assignee * User `json:"assignee,omitempty"`
50
+ Assignees []* User `json:"assignees,omitempty"`
51
+ Milestone * Milestone `json:"milestone,omitempty"`
52
+ MaintainerCanModify * bool `json:"maintainer_can_modify,omitempty"`
52
53
53
54
Head * PullRequestBranch `json:"head,omitempty"`
54
55
Base * PullRequestBranch `json:"base,omitempty"`
@@ -164,11 +165,12 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str
164
165
165
166
// NewPullRequest represents a new pull request to be created.
166
167
type NewPullRequest struct {
167
- Title * string `json:"title,omitempty"`
168
- Head * string `json:"head,omitempty"`
169
- Base * string `json:"base,omitempty"`
170
- Body * string `json:"body,omitempty"`
171
- Issue * int `json:"issue,omitempty"`
168
+ Title * string `json:"title,omitempty"`
169
+ Head * string `json:"head,omitempty"`
170
+ Base * string `json:"base,omitempty"`
171
+ Body * string `json:"body,omitempty"`
172
+ Issue * int `json:"issue,omitempty"`
173
+ MaintainerCanModify * bool `json:"maintainer_can_modify,omitempty"`
172
174
}
173
175
174
176
// Create a new pull request on the specified repository.
@@ -191,16 +193,17 @@ func (s *PullRequestsService) Create(ctx context.Context, owner string, repo str
191
193
}
192
194
193
195
type pullRequestUpdate struct {
194
- Title * string `json:"title,omitempty"`
195
- Body * string `json:"body,omitempty"`
196
- State * string `json:"state,omitempty"`
197
- Base * string `json:"base,omitempty"`
196
+ Title * string `json:"title,omitempty"`
197
+ Body * string `json:"body,omitempty"`
198
+ State * string `json:"state,omitempty"`
199
+ Base * string `json:"base,omitempty"`
200
+ MaintainerCanModify * bool `json:"maintainer_can_modify,omitempty"`
198
201
}
199
202
200
203
// Edit a pull request.
201
204
// pull must not be nil.
202
205
//
203
- // The following fields are editable: Title, Body, State, and Base.Ref.
206
+ // The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify .
204
207
// Base.Ref updates the base branch of the pull request.
205
208
//
206
209
// GitHub API docs: https://developer.github.com/v3/pulls/#update-a-pull-request
@@ -212,9 +215,10 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin
212
215
u := fmt .Sprintf ("repos/%v/%v/pulls/%d" , owner , repo , number )
213
216
214
217
update := & pullRequestUpdate {
215
- Title : pull .Title ,
216
- Body : pull .Body ,
217
- State : pull .State ,
218
+ Title : pull .Title ,
219
+ Body : pull .Body ,
220
+ State : pull .State ,
221
+ MaintainerCanModify : pull .MaintainerCanModify ,
218
222
}
219
223
if pull .Base != nil {
220
224
update .Base = pull .Base .Ref
0 commit comments