toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final accessToken = this.accessToken;
  final deviceId = this.deviceId;
  final expiresInMs = this.expiresInMs;
  final homeServer = this.homeServer;
  final refreshToken = this.refreshToken;
  return {
    if (accessToken != null) 'access_token': accessToken,
    if (deviceId != null) 'device_id': deviceId,
    if (expiresInMs != null) 'expires_in_ms': expiresInMs,
    if (homeServer != null) 'home_server': homeServer,
    if (refreshToken != null) 'refresh_token': refreshToken,
    'user_id': userId,
  };
}