mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 14:15:12 +00:00
Add sort and direction to PullRequestRequest
This commit is contained in:
@@ -167,7 +167,7 @@ namespace Octokit
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The pull request number</param>
|
||||
/// <returns>A <see cref="IReadOnlyList{PullRequestFile}"/> of <see cref="Files"/>s which are part of this pull request</returns>
|
||||
/// <returns>A <see cref="IReadOnlyList{PullRequestFile}"/> which are part of this pull request</returns>
|
||||
public Task<IReadOnlyList<PullRequestFile>> Files(string owner, string name, int number)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using Octokit.Internal;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
@@ -10,6 +11,8 @@ namespace Octokit
|
||||
public PullRequestRequest()
|
||||
{
|
||||
State = ItemState.Open;
|
||||
SortProperty = PullRequestSort.Created;
|
||||
SortDirection = SortDirection.Descending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -27,6 +30,18 @@ namespace Octokit
|
||||
/// </summary>
|
||||
public string Base { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// What property to sort pull requests by.
|
||||
/// </summary>
|
||||
[Parameter(Key="sort")]
|
||||
public PullRequestSort SortProperty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// What direction to sort the pull requests.
|
||||
/// </summary>
|
||||
[Parameter(Key="direction")]
|
||||
public SortDirection SortDirection { get; set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get
|
||||
@@ -35,4 +50,25 @@ namespace Octokit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum PullRequestSort
|
||||
{
|
||||
/// <summary>
|
||||
/// Sort by created date (default)
|
||||
/// </summary>
|
||||
Created,
|
||||
/// <summary>
|
||||
/// Sort by last updated date
|
||||
/// </summary>
|
||||
Updated,
|
||||
/// <summary>
|
||||
/// Sort by popularity (comment count)
|
||||
/// </summary>
|
||||
Popularity,
|
||||
/// <summary>
|
||||
/// Sort by age (filtering by pulls updated in the last month)
|
||||
/// </summary>
|
||||
[Parameter(Key="long-running")]
|
||||
LongRunning
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,16 +27,16 @@ namespace Octokit
|
||||
Patch = patch;
|
||||
}
|
||||
|
||||
public string Sha { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public string Status { get; set; }
|
||||
public int Additions { get; set; }
|
||||
public int Deletions { get; set; }
|
||||
public int Changes { get; set; }
|
||||
public Uri BlobUri { get; set; }
|
||||
public Uri RawUri { get; set; }
|
||||
public Uri ContentsUri { get; set; }
|
||||
public string Patch { get; set; }
|
||||
public string Sha { get; protected set; }
|
||||
public string FileName { get; protected set; }
|
||||
public string Status { get; protected set; }
|
||||
public int Additions { get; protected set; }
|
||||
public int Deletions { get; protected set; }
|
||||
public int Changes { get; protected set; }
|
||||
public Uri BlobUri { get; protected set; }
|
||||
public Uri RawUri { get; protected set; }
|
||||
public Uri ContentsUri { get; protected set; }
|
||||
public string Patch { get; protected set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user