DeekWebResponse<RequestType extends DeekWebRequest, ResponseType> class
The response returned from the server from DeekWebClient. Takes in two strongly typed entities, DeekWebRequest and ResponseType.
These represent the request used to call the service, as well as the expected response type.
Constructors
-
DeekWebResponse.fromCode({required DeekWebRequest<
ResponseType> request, int? statusCode, DeekWebException? exception, required int latencyMs}) - Creates a DeekWebResponse from a status code, with no response data.
-
DeekWebResponse.fromError({required DeekWebRequest<
ResponseType> request, required DeekWebException? exception}) - Creates a DeekWebResponse from an error, with no other response data.
-
DeekWebResponse.fromResponse({required DeekWebRequest<
ResponseType> request, required ResponseType? data, required int? statusCode, required int latencyMs}) - Creates a DeekWebResponse from a response from the server.
Properties
- data → ResponseType?
-
The parsed response from the server. Will be null if there was no
response.
final
- exception → DeekWebException?
-
The exception generated when calling the server, if any. This will be
null for successful request or for standard server errors.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- latencyMs → int
-
The amount of time, in milliseconds, that it took to call the server
and parse the response.
final
-
request
→ DeekWebRequest<
ResponseType> -
The request that was made to generate this response.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCode → int?
-
The status code for the response, if any. Will be null if calling the
server failed.
final
- wasSuccessful → bool
-
If the response from the server appears to be successful, as determined
by there being no exception and a statusCode in the 200-300 range.
no setter
Methods
-
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