TokenReviewStatus.fromJson constructor

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

Creates a TokenReviewStatus from JSON data.

Implementation

factory TokenReviewStatus.fromJson(Map<String, dynamic> json) {
  final tempAudiencesJson = json['audiences'];
  final tempAuthenticatedJson = json['authenticated'];
  final tempErrorJson = json['error'];
  final tempUserJson = json['user'];

  final List<String>? tempAudiences =
      tempAudiencesJson != null ? List<String>.from(tempAudiencesJson) : null;
  final bool? tempAuthenticated = tempAuthenticatedJson;
  final String? tempError = tempErrorJson;
  final UserInfo? tempUser =
      tempUserJson != null ? UserInfo.fromJson(tempUserJson) : null;

  return TokenReviewStatus(
    audiences: tempAudiences,
    authenticated: tempAuthenticated,
    error: tempError,
    user: tempUser,
  );
}