SouthAfricaDlBarcodeResult.fromJSON constructor
SouthAfricaDlBarcodeResult.fromJSON(
- Map<String, dynamic> json
)
Implementation
factory SouthAfricaDlBarcodeResult.fromJSON(Map<String, dynamic> json) {
ProfessionalDrivingPermit? professionalDrivingPermit;
if (json.containsKey("professionalDrivingPermit") && json["professionalDrivingPermit"] != null) {
professionalDrivingPermit =
ProfessionalDrivingPermit.fromJSON(json["professionalDrivingPermit"] as Map<String, dynamic>);
}
var vehicleRestrictions = <VehicleRestriction>[];
if (json.containsKey("vehicleRestrictions") && json["vehicleRestrictions"] != null) {
vehicleRestrictions.addAll((json['vehicleRestrictions'] as List<dynamic>)
.cast<Map<String, dynamic>>()
.map((e) => VehicleRestriction.fromJSON(e))
.toList()
.cast<VehicleRestriction>());
}
return SouthAfricaDlBarcodeResult._(
json["version"] as int,
json["licenseCountryOfIssue"] as String,
json["personalIdNumber"] as String,
json["personalIdNumberType"] as String,
json["documentCopy"] as int,
professionalDrivingPermit,
vehicleRestrictions,
(json["driverRestrictionCodes"] as List<dynamic>).cast<int>().toList());
}