RateLimit class abstract
Rate limit information.
- Available extensions
- Annotations
-
- @freezed
Constructors
- RateLimit({required RateLimitName name, required int limit, required int remaining, @JsonKey.new(name: 'reset_seconds') required double resetSeconds})
-
Factory constructor for RateLimit
constfactory
-
RateLimit.fromJson(Map<
String, dynamic> json) -
Object construction from a JSON representation
factory
Properties
-
copyWith
→ $RateLimitCopyWith<
RateLimit> -
Create a copy of RateLimit
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- limit → int
-
The maximum allowed value for the rate limit.
no setterinherited
- name → RateLimitName
-
The name of the rate limit (
requests,tokens).no setterinherited - remaining → int
-
The remaining value before the limit is reached.
no setterinherited
- resetSeconds → double
-
Seconds until the rate limit resets.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_RateLimit value)) → TResult -
Available on RateLimit, provided by the RateLimitPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_RateLimit value)?) → TResult? -
Available on RateLimit, provided by the RateLimitPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_RateLimit value)?, {required TResult orElse()}) → TResult -
Available on RateLimit, provided by the RateLimitPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(RateLimitName name, int limit, int remaining, double resetSeconds)?, {required TResult orElse()}) → TResult -
Available on RateLimit, provided by the RateLimitPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this RateLimit to a JSON map.
inherited
-
toMap(
) → Map< String, dynamic> - Map representation of object (not serialized)
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
) → String? - Perform validations on the schema property values
-
when<
TResult extends Object?> (TResult $default(RateLimitName name, int limit, int remaining, double resetSeconds)) → TResult -
Available on RateLimit, provided by the RateLimitPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(RateLimitName name, int limit, int remaining, double resetSeconds)?) → TResult? -
Available on RateLimit, provided by the RateLimitPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
propertyNames
→ const List<
String> - List of all property names of schema