RateLimit class final
Represents the rate limit applied to an API or a service.
Holds information like the limit count, remaining count, when the rate limit will reset, and the applied policy.
Constructors
-
RateLimit.fromHeaders(Map<
String, String> headers) -
Creates a
RateLimit
instance from HTTP headers.factory - RateLimit.unlimited()
-
Returns a rate limit instance which represents an unlimited rate limit.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isExceeded → bool
-
Indicates if the rate limit has been exceeded.
no setter
- isNotExceeded → bool
-
Indicates if the rate limit has not been exceeded.
no setter
- limitCount → int
-
Maximum number of allowed requests.
final
- policy → RateLimitPolicy
-
The rate limit policy being applied.
final
- remainingCount → int
-
Number of requests that can still be made.
final
- resetAt → DateTime
-
The time when the rate limit will reset.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
waitUntilReset(
) → Future< bool> - A utility function to wait until certain conditions related to rate limits are reset.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited