CDFApiClient class
Main API client class to set up and hold a CDF API connection.
If you want to test your app, inject CDFMockApiClient instead.
- Implementers
Constructors
- CDFApiClient({String? project, String? token, String? apikey, String baseUrl = 'https://api.cognitedata.com', Level logLevel = Level.warning, HttpClientAdapter? httpAdapter})
Properties
- apikey ↔ String?
-
apikey must be set with a CDF key that allows proper access.
getter/setter pair
- baseUrl ↔ String
-
baseUrl is set default to 'https://api.cognitedata.com'.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
history
→ List<
HistoryModel> -
access to full history of requests and responses.
no setter
- http → dynamic
-
getter to allow direct access to dio() instance from API classes.
no setter
- httpAdapter ↔ HttpClientAdapter?
-
getter/setter pair
- logLevel ↔ Level
-
Import logger package to use Level.* and set log level.
getter/setter pair
- project ↔ String?
-
project must be set to the CDF project to access.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token ↔ String?
-
token is a bearer token. If set, apikey is ignored.
getter/setter pair
Methods
-
getStatus(
) → Future< StatusModel> - Used to test against CDF to verify access. Returns empty StatusModel() on failure.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateToken(
String? token) → dynamic
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited