-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathPullRequestRequest.cs
More file actions
82 lines (71 loc) · 2.2 KB
/
Copy pathPullRequestRequest.cs
File metadata and controls
82 lines (71 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System.Diagnostics;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
/// <summary>
/// Used to filter requests for lists of pull requests.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PullRequestRequest : RequestParameters
{
public PullRequestRequest()
{
State = ItemStateFilter.Open;
SortProperty = PullRequestSort.Created;
SortDirection = SortDirection.Descending;
}
/// <summary>
/// Which PullRequests to get. The default is <see cref="ItemStateFilter.Open"/>
/// </summary>
public ItemStateFilter State { get; set; }
/// <summary>
/// Filter pulls by head user and branch name in the format of "user:ref-name".
/// </summary>
public string Head { get; set; }
/// <summary>
/// Filter pulls by base branch name.
/// </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
{
return string.Format(CultureInfo.InvariantCulture, "Base: {0} ", Base);
}
}
}
public enum PullRequestSort
{
/// <summary>
/// Sort by created date (default)
/// </summary>
[Parameter(Value = "created")]
Created,
/// <summary>
/// Sort by last updated date
/// </summary>
[Parameter(Value = "updated")]
Updated,
/// <summary>
/// Sort by popularity (comment count)
/// </summary>
[Parameter(Value = "popularity")]
Popularity,
/// <summary>
/// Sort by age (filtering by pulls updated in the last month)
/// </summary>
[Parameter(Value = "long-running")]
LongRunning
}
}