TeslaAuthToken.fromJson constructor

TeslaAuthToken.fromJson(
  1. Map<String, dynamic> json
)

Creates a new TeslaAuthToken from a JSON object.

Expects the following keys in the map: 'access_token', 'token_type', 'expires_in', 'refresh_token', 'created_at'.

Implementation

factory TeslaAuthToken.fromJson(Map<String, dynamic> json) {
  return TeslaAuthToken(
    accessToken: json['access_token'],
    tokenType: json['token_type'],
    expiresIn: json['expires_in'],
    refreshToken: json['refresh_token'],
    createdAt: json['created_at'],
  );
}