class Token {
  String accessToken;

  String refreshToken;

  String tokenType;

  int expiresIn;

  String scope;

  Token(this.accessToken, this.refreshToken, this.tokenType, this.expiresIn,
      this.scope);

  factory Token.fromJsonMap(Map<String, dynamic> json) {
    return Token(
      json['access_token'] ?? "",
      json['refresh_token'] ?? "",
      json['token_type'] ?? "",
      json['expires_in'] ?? 0,
      json['scope'] ?? "",
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['access_token'] = accessToken;
    data['refresh_token'] = refreshToken;
    data['token_type'] = tokenType;
    data['expires_in'] = expiresIn;
    data['scope'] = scope;
    return data;
  }
}
