-
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 GetRateLimits to MiscellaneousClient #848
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d88f180
Added GetRateLimits to MiscellaneousClient
e092a10
Additional changes to support rate_limit API call
d5d264d
Added changes to handle NETFX_CORE properly (I hope)
2314b62
Resolved merge conflicts in project files
0405718
Fixes to project files after corrupting them with merge
4d9cc4f
Additional changes following review
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Octokit | ||
{ | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class MiscellaneousRateLimit | ||
{ | ||
public MiscellaneousRateLimit() {} | ||
|
||
public MiscellaneousRateLimit(ResourceRateLimit resources, RateLimit rate) | ||
{ | ||
Ensure.ArgumentNotNull(resources, "resource"); | ||
Ensure.ArgumentNotNull(rate, "rate"); | ||
|
||
Resources = resources; | ||
Rate = rate; | ||
} | ||
|
||
/// <summary> | ||
/// Object of resources rate limits | ||
/// </summary> | ||
public ResourceRateLimit Resources { get; private set; } | ||
|
||
/// <summary> | ||
/// Legacy rate limit - to be depreciated - https://developer.github.com/v3/rate_limit/#deprecation-notice | ||
/// </summary> | ||
public RateLimit Rate { get; private set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return Resources == null ? "No rates found" : String.Format(CultureInfo.InvariantCulture, Resources.DebuggerDisplay); | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
|
||
using Octokit.Helpers; | ||
|
||
namespace Octokit | ||
{ | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class ResourceRateLimit | ||
{ | ||
public ResourceRateLimit() {} | ||
|
||
public ResourceRateLimit(RateLimit core, RateLimit search) | ||
{ | ||
Ensure.ArgumentNotNull(core, "core"); | ||
Ensure.ArgumentNotNull(search, "search"); | ||
|
||
Core = core; | ||
Search = search; | ||
} | ||
|
||
/// <summary> | ||
/// Rate limits for core API (rate limit for everything except Search API) | ||
/// </summary> | ||
public RateLimit Core { get; private set; } | ||
|
||
/// <summary> | ||
/// Rate Limits for Search API | ||
/// </summary> | ||
public RateLimit Search { get; private set; } | ||
|
||
internal string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return String.Format(CultureInfo.InvariantCulture, "Core: {0}; Search: {1} ", Core.DebuggerDisplay, Search.DebuggerDisplay); | ||
} | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.
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.
I'd rather we just use
RateLimit
and not this class. The name of this class is too similar toResourceRateLimits
. The data we show in this response and in the headers are the same and not likely to change (as we try and avoid breaking changes).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.
Changed now to use RateLimit
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.
I'm not sure where we ended up with this - is it
ResourceRateLimit
orRateLimit
?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.
Three models in use:
Hopefully that makes sense
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.
👍