RateLimitStatus#
- class gafaelfawr.models.userinfo.RateLimitStatus(limit, used, remaining, reset, resource)#
Bases:
object
Current status of rate limiting for a user for one API.
This is an internal model used to hold rate limiting status information that will be returned to the user in HTTP headers. It represents a fixed window rate limit algorithm.
Attributes Summary
Total number of API requests allowed to this service.
Number of API requests remaining in the rate limit period.
Time at which the rate limit window will reset.
Name of the resource being rate limited (the API service name).
Number of API requests used in the rate limit period.
Methods Summary
Return the rate limit status as HTTP headers.
Attributes Documentation
-
limit:
int
= <dataclasses._MISSING_TYPE object># Total number of API requests allowed to this service.
-
remaining:
int
= <dataclasses._MISSING_TYPE object># Number of API requests remaining in the rate limit period.
-
reset:
datetime
= <dataclasses._MISSING_TYPE object># Time at which the rate limit window will reset.
-
resource:
str
= <dataclasses._MISSING_TYPE object># Name of the resource being rate limited (the API service name).
-
used:
int
= <dataclasses._MISSING_TYPE object># Number of API requests used in the rate limit period.
Methods Documentation
- to_http_headers()#
Return the rate limit status as HTTP headers.
The headers were chosen to match the GitHub rate limit implementation.
-
limit: