toJson method

Map<String, Object> toJson()

Converts a TokenReviewStatus instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempAudiences = audiences;
  final tempAuthenticated = authenticated;
  final tempError = error;
  final tempUser = user;

  if (tempAudiences != null) {
    jsonData['audiences'] = tempAudiences;
  }

  if (tempAuthenticated != null) {
    jsonData['authenticated'] = tempAuthenticated;
  }

  if (tempError != null) {
    jsonData['error'] = tempError;
  }

  if (tempUser != null) {
    jsonData['user'] = tempUser.toJson();
  }

  return jsonData;
}