Allowance class

Constructors

Allowance({int? limit, String? plan, int? resets, bool? spent, int? used, String? window})
Returns a new Allowance instance.

Properties

hashCode → int
The hash code for this object.
no setteroverride
limit ↔ int?
calls the plan allows per period; 0 = unbounded
getter/setter pair
plan ↔ String?
the tier the limit came from
getter/setter pair
resets ↔ int?
unix seconds; when THAT window starts again
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spent ↔ bool?
the subject is at the limit
getter/setter pair
used ↔ int?
Used is how many zero-priced calls this subject has been SERVED in the period ending at Resets — the UTC calendar day. Only a served call counts, so an admission check, a refusal, or a vendor that never answered leaves it where it stood. It stops AT Limit rather than climbing past it, so Limit-Used is what remains and never goes negative.
getter/setter pair
window ↔ String?
Window is which ceiling these numbers describe — "hour" or "day" — because a caller is held to both and only one of them is the answer. It is the window that REFUSED where one did, and otherwise the one with least left, so Limit-Used is always the number that will actually stop them next. Empty where no window bounds the subject at all.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → Allowance?
Returns a new Allowance instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<Allowance>
mapFromJson(dynamic json) → Map<String, Allowance>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<Allowance>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.