-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added enum ItemStateFilter to differentiate between search and list APIs #1140
Changes from 14 commits
7688d61
2dc6826
39a810a
d03e37b
0f5d7c4
9fd1c02
546d7d5
56791f2
397b1f1
786b8e1
57f3e0a
4057a79
854ae96
8c9de09
da1485c
d37774a
c51bb07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ public class IssueRequest : RequestParameters | |
public IssueRequest() | ||
{ | ||
Filter = IssueFilter.Assigned; | ||
State = ItemState.Open; | ||
State = ItemStateFilter.Open; | ||
Labels = new Collection<string>(); | ||
SortProperty = IssueSort.Created; | ||
SortDirection = SortDirection.Descending; | ||
|
@@ -33,12 +33,12 @@ public IssueRequest() | |
public IssueFilter Filter { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the <see cref="ItemState"/> for the issues to return. | ||
/// Gets or sets the <see cref="ItemStateFilter"/> for the issues to return. | ||
/// </summary> | ||
/// <value> | ||
/// The state. | ||
/// </value> | ||
public ItemState State { get; set; } | ||
public ItemStateFilter State { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the labels to filter by. Add labels to the collection to only request issues with those labels. | ||
|
@@ -121,23 +121,45 @@ public enum IssueFilter | |
} | ||
|
||
/// <summary> | ||
/// The range of states that an issue can be in. | ||
/// Range of states for "Issues", "Milestones" and "Pull Request" API. | ||
/// </summary> | ||
public enum ItemStateFilter | ||
{ | ||
/// <summary> | ||
/// Items that are open. | ||
/// </summary> | ||
Open, | ||
|
||
/// <summary> | ||
/// Items that are closed. | ||
/// </summary> | ||
Closed, | ||
|
||
/// <summary> | ||
/// All the items. | ||
/// </summary> | ||
All | ||
} | ||
|
||
/// <summary> | ||
/// Items that are open OR closed | ||
/// </summary> | ||
public enum ItemState | ||
{ | ||
/// <summary> | ||
/// Isuses that are open (default). | ||
/// Issues that are open | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's word this "Items that are open" |
||
/// </summary> | ||
Open, | ||
|
||
/// <summary> | ||
/// Isuses that are closed. | ||
/// Issues that are closed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's word this "Items that are closed" |
||
/// </summary> | ||
Closed, | ||
|
||
/// <summary> | ||
/// All the issues. | ||
/// All the issues. The option is Obsolete | ||
/// </summary> | ||
[Obsolete("The value is Obsolete and will be removed in a future release as it is not a valid option for Search, Create and Update operations")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As agreed by @shiftkey we can just DROP the |
||
All | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,4 +93,4 @@ public void ClearLabels() | |
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,15 @@ public class MilestoneRequest : RequestParameters | |
{ | ||
public MilestoneRequest() | ||
{ | ||
State = ItemState.Open; | ||
State = ItemStateFilter.Open; | ||
SortProperty = MilestoneSort.DueDate; | ||
SortDirection = SortDirection.Ascending; | ||
} | ||
|
||
public ItemState State { get; set; } | ||
/// <summary> | ||
/// Which Milestones to get. The default is <see cref="ItemStateFilter.Open"/>. | ||
/// </summary> | ||
public ItemStateFilter State { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where I would mention the default |
||
|
||
[Parameter(Key = "sort")] | ||
public MilestoneSort SortProperty { get; set; } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,15 +13,15 @@ public class PullRequestRequest : RequestParameters | |
{ | ||
public PullRequestRequest() | ||
{ | ||
State = ItemState.Open; | ||
State = ItemStateFilter.Open; | ||
SortProperty = PullRequestSort.Created; | ||
SortDirection = SortDirection.Descending; | ||
} | ||
|
||
/// <summary> | ||
/// "open" or "closed" to filter by state. Default is "open". | ||
/// "open", "closed" or "all" to filter by state. Default is "open". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps word this consistently with the other
|
||
/// </summary> | ||
public ItemState State { get; set; } | ||
public ItemStateFilter State { get; set; } | ||
|
||
/// <summary> | ||
/// Filter pulls by head user and branch name in the format of "user:ref-name". | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ public Issue(Uri url, Uri htmlUrl, Uri commentsUrl, Uri eventsUrl, int number, I | |
public int Number { get; protected set; } | ||
|
||
/// <summary> | ||
/// Whether the issue is open or closed. | ||
/// Whether the issue is "open", "closed" or "all". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're going to |
||
/// </summary> | ||
public ItemState State { get; protected set; } | ||
|
||
|
@@ -155,4 +155,4 @@ public IssueUpdate ToUpdate() | |
return issueUpdate; | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about the quotation marks here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shiftkey Removed the quotation marks. 😄