Principal.fromJson constructor

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

Implementation

factory Principal.fromJson(Map<String, dynamic> json) {
  return Principal(
    id: json['Id'] as String?,
    roles: (json['Roles'] as List?)
        ?.whereNotNull()
        .map((e) => PermissionInfo.fromJson(e as Map<String, dynamic>))
        .toList(),
    type: (json['Type'] as String?)?.toPrincipalType(),
  );
}