-
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
Implement improved labels API #1802
Merged
+436
−74
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
728fc79
Implement new attributes for labels
jozefizso 646aeaf
Include correct API header in all Labels calls
jozefizso e1de738
Add integration tests for Create and Update methods for labels
jozefizso 13782f2
Use improved labels API in observable client
jozefizso 2827286
found even more endpoints that need the preview header!
ryangribble 9f46ca1
RemoveFromIssue actually returns the list of remaining labels rather …
ryangribble 1472fd3
Implement new labels search method in SearchClient
ryangribble 8fe42d3
Implement reactive client SearchLabels
ryangribble 7bce8aa
Improve documentation for label search methods
jozefizso ecbfd5b
more comment tidy up
ryangribble File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,32 @@ public class NewLabel | |
/// </summary> | ||
/// <param name="name">The name of the label.</param> | ||
/// <param name="color">The color of the label.</param> | ||
public NewLabel(string name, string color) | ||
/// <param name="description">The description of the label.</param> | ||
public NewLabel(string name, string color, string description = null) | ||
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. Optional field shouldn't be in the ctor |
||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); | ||
Ensure.ArgumentNotNullOrEmptyString(color, nameof(color)); | ||
|
||
Name = name; | ||
Color = color; | ||
Description = description; | ||
} | ||
|
||
/// <summary> | ||
/// Name of the label (required). | ||
/// </summary> | ||
/// <remarks> | ||
/// Emoji can be added to label names, using either native emoji or colon-style markup. For example, | ||
/// typing :strawberry: will render the emoji for strawberry. For a full list of available emoji and codes, see http://emoji-cheat-sheet.com/. | ||
/// </remarks> | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Color of the label (required). | ||
/// </summary> | ||
/// <remarks> | ||
/// The hexadecimal color code for the label, without the leading #. | ||
/// </remarks> | ||
public string Color | ||
{ | ||
get { return _color; } | ||
|
@@ -49,6 +58,11 @@ public string Color | |
} | ||
} | ||
|
||
/// <summary> | ||
/// A short description of the label (optional). | ||
/// </summary> | ||
public string Description { get; set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,13 @@ public class Label | |
{ | ||
public Label() { } | ||
|
||
public Label(string url, string name, string color) | ||
public Label(string url, string name, string color, string description, bool @default) | ||
{ | ||
Url = url; | ||
Name = name; | ||
Color = color; | ||
Description = description; | ||
IsDefault = @default; | ||
} | ||
|
||
/// <summary> | ||
|
@@ -30,6 +32,16 @@ public Label(string url, string name, string color) | |
/// </summary> | ||
public string Color { get; protected set; } | ||
|
||
/// <summary> | ||
/// Description of the label | ||
/// </summary> | ||
public string Description { get; protected set; } | ||
|
||
/// <summary> | ||
/// Is default label | ||
/// </summary> | ||
public bool IsDefault { get; protected 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. I think this will need to be named Default to match the json response field |
||
|
||
internal string DebuggerDisplay | ||
{ | ||
get { return string.Format(CultureInfo.InvariantCulture, "Name: {0} Color: {1}", Name, Color); } | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To be consistent with the rest of the library, the request model constructor should only take required parameters. Optional parameters can be set via object initializer pattern