Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds MaintainerCanModify to PullRequest #1771

Merged
merged 12 commits into from
Apr 23, 2018
8 changes: 7 additions & 1 deletion Octokit/Models/Response/PullRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public PullRequest(int number)
Number = number;
}

public PullRequest(long id, string url, string htmlUrl, string diffUrl, string patchUrl, string issueUrl, string statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, MergeableState? mergeableState, User mergedBy, string mergeCommitSha, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked, IReadOnlyList<User> requestedReviewers)
public PullRequest(long id, string url, string htmlUrl, string diffUrl, string patchUrl, string issueUrl, string statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, MergeableState? mergeableState, User mergedBy, string mergeCommitSha, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked, bool maintainerCanModify, IReadOnlyList<User> requestedReviewers)
{
Id = id;
Url = url;
Expand Down Expand Up @@ -49,6 +49,7 @@ public PullRequest(long id, string url, string htmlUrl, string diffUrl, string p
ChangedFiles = changedFiles;
Milestone = milestone;
Locked = locked;
MaintainerCanModify = maintainerCanModify;
RequestedReviewers = requestedReviewers;
}

Expand Down Expand Up @@ -219,6 +220,11 @@ public bool Merged
/// </summary>
public bool Locked { get; protected set; }

/// <summary>
/// If users with write access to the base repository can push to the HEAD branch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we reword this slightly?

"Whether maintainers of the base repository can push to the HEAD branch"

/// </summary>
public bool MaintainerCanModify { get; protected set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make this nullable bool? MaintainerCanModify because responses that return lists of pull requests will not return this field, so rather than indicate it as false in that case, we should indicate it as null


/// <summary>
/// Users requested for review
/// </summary>
Expand Down