TeslaAuthToken class
Represents an access token returned from the Tesla API.
Includes the following fields:
- accessToken: The token that can be used for accessing Tesla API.
- tokenType: The type of token, typically "Bearer".
- expiresIn: The number of seconds the token is valid for since its creation.
- refreshToken: The token that can be used to refresh the access token after it expires.
- createdAt: The time at which the token was created, as a Unix timestamp.
Constructors
- TeslaAuthToken({required String accessToken, required String tokenType, required int expiresIn, required String refreshToken, required int createdAt})
- Creates a new TeslaAuthToken with the given values.
-
TeslaAuthToken.fromJson(Map<
String, dynamic> json) -
Creates a new TeslaAuthToken from a JSON object.
factory
Properties
- accessToken → String
-
Access token for the Tesla API.
final
- createdAt → int
-
Time at which the token was created, as a Unix timestamp.
final
- expiresIn → int
-
Number of seconds the token is valid for since its creation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- refreshToken → String
-
Token that can be used to refresh the access token after it expires.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tokenType → String
-
Type of the token, typically "Bearer".
final
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