Skip to content

Commit

Permalink
Adds MaintainerCanModify to PullRequest (#1771)
Browse files Browse the repository at this point in the history
* Adds MaintainerCanModify to PullRequest

* Make MaintainerCanModify nullable

* Tweak MaintainerCanModify doc comment

* Add MaintainerCanModify to NewPullRequest

* Add MaintainerCanModify to PullRequestUpdate

* Update NewPulRequest tests

* Convert tabs to spaces

* Fix PullRequestUpdate and NewPullRequest doc comments

* Revert "Update NewPulRequest tests"

This reverts commit f20dfa7.

* Make MaintainerCanModify fields nullable

* tweak doco comment and make setter public so it can be used
  • Loading branch information
Cyberboss authored and ryangribble committed Apr 23, 2018
1 parent e51cc45 commit 82b1b21
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Octokit/Models/Request/NewPullRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public NewPullRequest(string title, string head, string baseRef)
/// </summary>
public string Head { get; private set; }

/// <summary>
/// Whether maintainers of the base repository can push to the HEAD branch (optional).
/// </summary>
public bool? MaintainerCanModify { get; set; }

/// <summary>
/// Body of the pull request (optional)
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions Octokit/Models/Request/PullRequestUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public class PullRequestUpdate
/// </summary>
public string Base { get; set; }

/// <summary>
/// Whether maintainers of the base repository can push to the HEAD branch.
/// </summary>
public bool? MaintainerCanModify { get; set; }

internal string DebuggerDisplay
{
get
Expand Down
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>
/// Whether maintainers of the base repository can push to the HEAD branch
/// </summary>
public bool? MaintainerCanModify { get; protected set; }

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

0 comments on commit 82b1b21

Please sign in to comment.