RateLimitInfo class final
The structured decode of a provider 429 (issue #867). Every field is
nullable — unknown payload shapes degrade to the generic human message
instead of leaking null into a transcript.
Constructors
- RateLimitInfo({String? errorType, String? planType, DateTime? resetsAt, int? resetsInSeconds, String? eligiblePromo, String? limitKind, String? brand, Duration? retryAfter, String rawBody = ''})
-
Creates the info;
rawBodykeeps the full payload for diagnostics.const -
RateLimitInfo.fromJson(Map<
String, dynamic> json) -
factory
Properties
- brand → String?
-
The provider display name enriching the plan title (
ChatGPTon the codex adapter).null— the generic parse layer — keeps the title neutral: any endpoint or proxy can answer a 429 with a plan body.final - eligiblePromo → String?
-
A promo the account is eligible for, when the payload advertises one.
final
- errorType → String?
-
The payload's error discriminator when it names one
(
usage_limit_reachedon ChatGPT-Codex).final - hashCode → int
-
The hash code for this object.
no setterinherited
- limitKind → String?
-
Which advertised window the reset belongs to (
primary/secondaryor the provider's own limit name), when the headers named one.final - planType → String?
-
The account plan the quota belongs to (
free,plus, …).final - rawBody → String
-
The full raw response body — diagnostics only, NEVER rendered on a
user surface (issue #867 AC5).
final
- resetsAt → DateTime?
-
Server-derived absolute reset moment (UTC), from
resets_at(unix seconds) or the provider's reset headers. Rendered in the device's time zone, never recomputed from the (possibly skewed) device clock.final - resetsInSeconds → int?
-
Server-derived seconds until the reset (
resets_in_seconds) — immune to device clock skew, so it wins for the countdown.final - retryAfter → Duration?
-
The provider-suggested wait parsed from the
Retry-Afterheader.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
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
-
withBrand(
String brand) → RateLimitInfo - Returns a copy enriched with the provider display name for the plan title. Only a branded adapter sets it — the codex endpoint IS the ChatGPT surface; the shared parse layer stays provider-neutral.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited