Skip to content

Commit

Permalink
Merge pull request #225 from bosquig/master
Browse files Browse the repository at this point in the history
Add RateLimitingCallsMade to LastRequestInfo ("x-ratelimit")
  • Loading branch information
iulian03 authored Nov 11, 2024
2 parents 1e4ed39 + 12090f6 commit 79c39dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MangoPay.SDK/Core/LastRequestInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class LastRequestInfo

public string RateLimitingCallsAllowed { get; set; }

public string RateLimitingCallsMade { get; set; }

public string RateLimitingCallsRemaining { get; set; }

public string RateLimitingTimeTillReset { get; set; }
Expand Down
1 change: 1 addition & 0 deletions MangoPay.SDK/Core/RestTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ string GetHeaderValue(string key)
_root.LastRequestInfo.RateLimitingCallsAllowed = GetHeaderValue("X-RateLimit-Limit");
_root.LastRequestInfo.RateLimitingCallsRemaining = GetHeaderValue("X-RateLimit-Remaining");
_root.LastRequestInfo.RateLimitingTimeTillReset = GetHeaderValue("X-RateLimit-Reset");
_root.LastRequestInfo.RateLimitingCallsMade = GetHeaderValue("X-RateLimit");
}

private async Task<ListPaginated<T>> DoRequestListAsync<T>(string urlMethod, Dictionary<string, string> additionalUrlParams = null,
Expand Down

0 comments on commit 79c39dd

Please sign in to comment.