Oauth2HttpHandler class

An HttpHandler that refreshes the OAuth2 access token if needed.

Inheritance

Constructors

Oauth2HttpHandler(NyxxOAuth2 client)
Create a new Oauth2HttpHandler.

Properties

apiOptions OAuth2ApiOptions
The options containing the credentials that may be refreshed.
final
buckets Map<String, HttpBucket>
A mapping of HttpRequest.rateLimitId to HttpBucket for rate limiting.
no setterinherited
client Nyxx
The client this handler is attached to.
finalinherited
globalReset DateTime?
The time at which the global rate limit resets.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
httpClient → Client
The HTTP client used to make requests.
finalinherited
latency Duration
The average time taken by the last 10 requests to get a response.
no setterinherited
logger Logger
no setterinherited
onRateLimit Stream<RateLimitInfo>
A stream that emits an event when a request is delayed because of a rate limit.
no setterinherited
onRequest Stream<HttpRequest>
A stream of requests executed by this handler.
no setterinherited
onResponse Stream<HttpResponse>
A stream of responses received by this handler.
no setterinherited
realLatency Duration
The average network and API latency of the last 10 requests.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
inherited
execute(HttpRequest request) Future<HttpResponse>
Send request to the API and return the response.
inherited
executeSafe(HttpRequest request) Future<HttpResponseSuccess>
Execute request and throw the response if it is not a HttpResponseSuccess.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited